mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
added onNativeReady and onDOMContentLoaded events
This commit is contained in:
@@ -56,21 +56,4 @@ Device.prototype.exitApp = function()
|
||||
|
||||
PhoneGap.addConstructor(function() {
|
||||
navigator.device = window.device = new Device();
|
||||
});
|
||||
|
||||
|
||||
PhoneGap.onDeviceReady = new PhoneGap.Channel();
|
||||
|
||||
PhoneGap.__document_addEventListener = document.addEventListener;
|
||||
|
||||
document.addEventListener = function(evt, handler, capture) {
|
||||
if (evt.toLowerCase() == 'deviceready') {
|
||||
PhoneGap.onDeviceReady.sob(handler);
|
||||
} else {
|
||||
PhoneGap.__document_addEventListener.call(document, evt, handler);
|
||||
}
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
PhoneGap.onDeviceReady.fire();
|
||||
})
|
||||
});
|
||||
Reference in New Issue
Block a user