Skip to content

Instantly share code, notes, and snippets.

@sbellity
Created March 30, 2016 15:53
Show Gist options
  • Save sbellity/74c28f7846822b9d4df2e4494261579a to your computer and use it in GitHub Desktop.
Save sbellity/74c28f7846822b9d4df2e4494261579a to your computer and use it in GitHub Desktop.
Display modal on page load and force reopen it on closed
window.hullAsyncInit = function() {
function showDialog() {
setTimeout(function() {
if (!Hull.currentUser()) {
Hull.emit('hull.login.showDialog');
}
}, 500);
}
// Show dialog on page load
Hull.on('hull.ships.ready', showDialog)
// Reopen dialog when it's closed
Hull.on('hull.login.dialogHidden', showDialog)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment