Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
reset install button if too much time has elapsed or user has dismiss…
Browse files Browse the repository at this point in the history
…ed doorhanger (bug 749691)
  • Loading branch information
cvan committed Jun 2, 2012
1 parent 1cb7644 commit c2110a7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions media/js/mkt/buttons.js
Expand Up @@ -43,8 +43,20 @@

setButton($button, gettext('Purchased'), 'purchased');
}).bind('app_install_start', function(e, product) {
setButton(getButton(product),
gettext('Installing…'), 'installing');
var $button = getButton(product);
setButton($button, gettext('Installing…'), 'installing');

// Reset button if we've clicked outside of the doorhanger (albeit twice).
$(document.body).on('click', function() {
revertButton($button);
});

// Reset button if it's been 30 seconds without user action.
setTimeout(function() {
if ($button.hasClass('installing')) {
revertButton($button);
}
}, 30000);
}).bind('app_install_success', function(e, product, installedNow) {
var $button = getButton(product);
if (installedNow) {
Expand Down

0 comments on commit c2110a7

Please sign in to comment.