Changeset 526 for trunk


Ignore:
Timestamp:
07/18/06 23:13:39 (13 years ago)
Author:
mokhet
Message:

fix whenDocReady method to be able to use it before InitIframe? (before the editor is generated). this._doc is checked before this._doc.body in this matter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/htmlarea.js

    r519 r526  
    22272227}; 
    22282228   
    2229 /** Delay a function until the document is ready for operations.  See ticket:547 */ 
    2230 HTMLArea.prototype.whenDocReady = function(doFunction) 
    2231 { 
    2232   var editor = this;   
    2233    
    2234   if ( !this._doc.body ) 
    2235   { 
    2236     setTimeout(function() { editor.whenDocReady(doFunction); }, 50); 
     2229/** 
     2230 * Delay a function until the document is ready for operations. 
     2231 * See ticket:547 
     2232 * @param {object} F (Function) The function to call once the document is ready 
     2233 * @public 
     2234 */ 
     2235HTMLArea.prototype.whenDocReady = function(F) 
     2236{ 
     2237  var E = this; 
     2238  if ( this._doc && this._doc.body ) 
     2239  { 
     2240    F(); 
    22372241  } 
    22382242  else 
    22392243  { 
    2240     doFunction(); 
     2244    setTimeout(function() { E.whenDocReady(F); }, 50); 
    22412245  } 
    22422246}; 
Note: See TracChangeset for help on using the changeset viewer.