Created
June 25, 2014 23:05
-
-
Save kof/a69c93cb931d9fa6886b to your computer and use it in GitHub Desktop.
Famo.us app init
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exports.ready = new Promise(function(fulfill, reject) { | |
var isResized, isDomReady | |
var isDeviceReady = !window.cordova | |
context.on('resize', function() { | |
isResized = true | |
resolve() | |
}) | |
domready(function() { | |
isDomReady = true | |
resolve() | |
}) | |
document.addEventListener('deviceready', function() { | |
isDeviceReady = true | |
resolve() | |
}) | |
function resolve() { | |
if (isResized && isDomReady && isDeviceReady) fulfill() | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment