toggle wireup

This commit is contained in:
Adam Bradley
2013-09-27 09:55:01 -05:00
parent 72bae87ca7
commit 66bb676aa3
3 changed files with 47 additions and 2 deletions

29
ext/simple/init.js Normal file
View File

@ -0,0 +1,29 @@
(function(window, document, ionic) {
ionic.simple = {
};
function initalize() {
// remove the ready listeners
document.removeEventListener( "DOMContentLoaded", initalize, false );
window.removeEventListener( "load", initalize, false );
// trigger that the DOM is ready
ionic.trigger("domready");
}
// When the DOM is ready, initalize the webapp
if ( document.readyState === "complete" ) {
// DOM is already ready
setTimeout( initalize );
} else {
// DOM isn't ready yet, add event listeners
document.addEventListener( "DOMContentLoaded", initalize, false );
window.addEventListener( "load", initalize, false );
}
})(this, document, ionic);