mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-07 23:16:52 +08:00
31 lines
835 B
JavaScript
31 lines
835 B
JavaScript
(function(window, document, framework) {
|
|
|
|
// Start initalizing the framework
|
|
function initalize() {
|
|
|
|
|
|
framework.trigger("initalized");
|
|
}
|
|
|
|
// DOM has completed
|
|
function completed() {
|
|
// remove any listeners
|
|
document.removeEventListener( "DOMContentLoaded", completed, false );
|
|
window.removeEventListener( "load", completed, false );
|
|
framework.trigger("ready");
|
|
|
|
// init the framework
|
|
initalize();
|
|
}
|
|
|
|
// When the DOM is ready, call completed()
|
|
if ( document.readyState === "complete" ) {
|
|
// DOM is already ready
|
|
setTimeout( completed );
|
|
} else {
|
|
// DOM isn't ready yet, add event listeners
|
|
document.addEventListener( "DOMContentLoaded", completed, false );
|
|
window.addEventListener( "load", completed, false );
|
|
}
|
|
|
|
})(this, document, this.FM = this.FM || {}); |