Skip to content

Commit

Permalink
callback for addon helper installation in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
zalun committed Aug 14, 2010
1 parent 604cd7a commit fdafe21
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions flightdeck/jetpack/media/js/FlightDeck.Browser.js
Expand Up @@ -14,15 +14,26 @@ FlightDeck = Class.refactor(FlightDeck,{
$$('.{try_in_browser_class} a'.substitute(this.options)).each(function(el) {
el.addEvent('click', function(e){
e.stop();
var testThisXpi = function() {
new Request.JSON({
url: el.get('href'),
onSuccess: fd.testXPI.bind(fd)
}).send();
}
if (fd.alertIfNoAddOn()) {
if (el.getParent('li').hasClass('pressed')) {
fd.uninstallXPI(el.get('rel'));
} else {
new Request.JSON({
url: el.get('href'),
onSuccess: fd.testXPI.bind(fd)
}).send();
testThisXpi();
}
} else {
fd.whenAddonInstalled(function() {
fd.message.alert(
'Add-on Builder Helper',
'Now that you have installed the Add-ons Builder Helper, loading the add-on into your browser for testing...'
);
testThisXpi();
}.bind(this));
}
});
});
Expand Down

0 comments on commit fdafe21

Please sign in to comment.