Platform.ready() for excellence

This commit is contained in:
Adam Bradley
2015-06-26 10:49:03 -05:00
parent ef82b00f45
commit 69e7d7c69f
7 changed files with 68 additions and 84 deletions

View File

@ -121,16 +121,15 @@ Platform.register({
name: 'cordova',
isEngine: true,
methods: {
onReady: function() {
return new Promise(resolve => {
setTimeout(function() {
resolve();
}, 1000);
ready: function() {
return Platform.windowLoad().then(() => {
return new Promise(resolve => {
document.addEventListener("deviceready", resolve);
});
});
}
},
isMatch(p) {
return true;
return !!(window.cordova || window.PhoneGap || window.phonegap);
}
});