- Timestamp:
- 05/10/08 17:29:47 (7 months ago)
- Location:
- dojo/trunk
- Files:
-
- 3 modified
-
tests/_base/_loader/afterOnLoad.html (modified) (3 diffs)
-
_base/_loader/bootstrap.js (modified) (1 diff)
-
_base/_loader/loader.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
dojo/trunk/tests/_base/_loader/afterOnLoad.html
r12492 r13682 10 10 11 11 <script type="text/javascript"> 12 window.onload = function(){12 function init(){ 13 13 //Create global djConfig object first. We cannot use the djConfig attribute 14 14 //on the script tag since it may not be visible in some browsers at the time … … 20 20 parseOnLoad: true, 21 21 afterOnLoad:true, 22 addOnLoad: function(){ 23 //This function is registered with 24 //dojo.addOnLoad as Dojo is defined after 25 //being added to the DOM. 26 console.log("djConfig.addOnLoad callback fired OK: dojo.parser.parse is a " 27 + (typeof dojo.parser.parse)); 28 }, 22 29 require: [ 23 30 'dojo.parser', … … 37 44 console.debug("onChange for id = " + id + ", value: " + newValue); 38 45 } 46 47 //Register onload init function that will add Dojo to the page. 48 if(window.addEventListener){ 49 window.addEventListener("load", init, false); 50 }else{ 51 window.attachEvent("onload", init); 52 } 53 39 54 </script> 40 55 </head> -
dojo/trunk/_base/_loader/bootstrap.js
r13411 r13682 70 70 // modules may be configured via `djConfig.modulePaths`. 71 71 modulePaths: {}, 72 // afterOnLoad: Boolean 73 // Indicates Dojo was added to the page after the page load. In this case 74 // Dojo will not wait for the page DOMContentLoad/load events and fire 75 // its dojo.addOnLoad callbacks after making sure all outstanding 76 // dojo.required modules have loaded. 77 afterOnLoad: false, 78 // addOnLoad: Function or Array 79 // Adds a callback via dojo.addOnLoad. Useful when Dojo is added after 80 // the page loads and djConfig.afterOnLoad is true. Supports the same 81 // arguments as dojo.addOnLoad. When using a function reference, use 82 // `djConfig.addOnLoad = function(){};`. For object with function name use 83 // `djConfig.addOnLoad = [myObject, "functionName"];` and for object with 84 // function reference use 85 // `djConfig.addOnLoad = [myObject, function(){}];` 86 addOnLoad: null, 72 87 } 73 88 =====*/ -
dojo/trunk/_base/_loader/loader.js
r13283 r13682 203 203 d._callLoaded(); 204 204 } 205 } 206 207 //Support calling dojo.addOnLoad via djConfig.addOnLoad. Support all the 208 //call permutations of dojo.addOnLoad. Mainly useful when dojo is added 209 //to the page after the page has loaded. 210 var dca = d.config.addOnLoad; 211 if(dca){ 212 d.addOnLoad[(dca instanceof Array ? "apply" : "call")](d, dca); 205 213 } 206 214