Ticket #4767: 4767_4.patch
File 4767_4.patch, 2.6 KB (added by , 13 years ago) |
---|
-
_source/core/ckeditor_basic.js
231 231 } 232 232 }; 233 233 234 if ( window.addEventListener ) 235 window.addEventListener( 'load', onload, false ); 236 else if ( window.attachEvent ) 237 window.attachEvent( 'onload', onload ); 234 // If the initialization is done by putting ckeditor_source.js in the body then 235 // the scripts are loaded by setTimeout calls, so when it loads this one the document 236 // might be already loaded 237 // Unfortunately, Firefox <3.6 doesn't support document.readyState 238 if (document.readyState == 'complete') 239 setTimeout( onload, 0 ); 240 else 241 { 242 if ( window.addEventListener ) 243 window.addEventListener( 'load', onload, false ); 244 else if ( window.attachEvent ) 245 window.attachEvent( 'onload', onload ); 246 } 238 247 })(); 239 248 240 249 CKEDITOR.status = 'basic_loaded'; -
_source/core/loader.js
161 161 162 162 // We must guarantee the execution order of the scripts, so we 163 163 // need to load them one by one. (#4145) 164 // The followin if/else block has been taken from the scriptloader core code.165 if ( CKEDITOR.env.ie)164 // The following if/else block has been taken from the scriptloader core code. 165 if ( typeof(script.onreadystatechange) !== "undefined" ) 166 166 { 167 167 /** @ignore */ 168 168 script.onreadystatechange = function() … … 190 190 191 191 /** 192 192 * Loads a specific script, including its dependencies. This is not a 193 * synchronous loading, which means that the code t hebe loaded will193 * synchronous loading, which means that the code to be loaded will 194 194 * not necessarily be available after this call. 195 195 * @example 196 196 * CKEDITOR.loader.load( 'core/dom/element' ); … … 217 217 var scriptSrc = getUrl( '_source/' + scriptName + '.js' ); 218 218 219 219 // Append the <script> element to the DOM. 220 if ( document.body ) 220 // If the page is fully loaded, we can't use document.write 221 // but if the script is run while the body is loading then it's safe to use it 222 // Unfortunately, Firefox <3.6 doesn't support document.readyState, so it won't get this improvement 223 if ( document.body && (!document.readyState || document.readyState == 'complete') ) 221 224 { 222 225 pendingLoad.push( scriptName ); 223 226