Created
October 2, 2013 11:24
-
-
Save jorisroovers/6792295 to your computer and use it in GitHub Desktop.
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
// runner | |
function Runner() { | |
this.descriptionDefer = $.Deferred(); | |
this.descriptionPromise = this.descriptionDefer.promise(); | |
} | |
Runner.prototype.stop = function() { | |
this.descriptionDefer.resolve(this.descriptionDefer); | |
} | |
Runner.prototype.runSequentially = function(steps){ | |
var self = this; | |
var stepCounter = 0; | |
self.descriptionDefer.then(null, null, function(){ | |
if (stepCounter == steps.length){ | |
self.descriptionDefer.resolve(self.descriptionDefer); | |
} else { | |
steps[stepCounter](self.descriptionDefer); | |
stepCounter++; | |
} | |
}); | |
self.descriptionDefer.notify(); // start first step | |
return self.descriptionPromise; | |
} | |
function descr_welcomeModal(mydefer){ | |
setTimeout(function(){ | |
// backdrop has issue due to positioning + it doesn't look too good on the page | |
$('#welcomeModal').modal({backdrop: false}); | |
$('#welcomeModal').on('hidden', function (){ | |
mydefer.notify(); | |
}); | |
}, 500); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment