-
Notifications
You must be signed in to change notification settings - Fork 0
/
cordova.js
33 lines (30 loc) · 1.06 KB
/
cordova.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
(function () {
"use strict";
if (typeof cordova === "undefined") {
var event; // The custom event that will be created
if (document.createEvent) {
event = document.createEvent("HTMLEvents");
event.initEvent("deviceready", true, true);
} else {
event = document.createEventObject();
event.eventType = "deviceready";
}
event.eventName = "deviceready";
$(document).ready(function () {
function checkForDeviceReady() {
window.setTimeout(function () {
if (typeof WinJS !== "object") {
checkForDeviceReady();
} else {
if (document.dispatchEvent) {
document.dispatchEvent(event);
} else {
document.fireEvent("on" + event.eventType, event);
}
}
}, 100);
}
checkForDeviceReady();
});
}
})();