Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Use .oninstall/onuninstall in the dashboard instead of addEventListen…
Browse files Browse the repository at this point in the history
…er, because Nightly currently only implements the former.
  • Loading branch information
ianb committed Mar 21, 2012
1 parent 9bf5449 commit ee3accb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions site/js/jibe.js
Expand Up @@ -137,9 +137,9 @@ $(document).ready(function() {
function eventUninstall(ev) { function eventUninstall(ev) {
doUpdate("uninstall", [ev.application]); doUpdate("uninstall", [ev.application]);
} }
if (navigator.mozApps.mgmt.addEventListener) { if (navigator.mozApps.getInstalled) {
navigator.mozApps.mgmt.addEventListener('install', eventInstall); navigator.mozApps.mgmt.oninstall = eventInstall;
navigator.mozApps.mgmt.addEventListener('uninstall', eventUninstall); navigator.mozApps.mgmt.onuninstall = eventUninstall;
eventListenerBound = true; eventListenerBound = true;
} }


Expand All @@ -149,8 +149,8 @@ $(document).ready(function() {
navigator.mozApps.mgmt.clearWatch(watcherID); navigator.mozApps.mgmt.clearWatch(watcherID);
} }
if (eventListenerBound) { if (eventListenerBound) {
navigator.mozApps.mgmt.removeEventListener('install', eventInstall); navigator.mozApps.mgmt.oninstall = null;
navigator.mozApps.mgmt.removeEventListener('uninstall', eventUninstall); navigator.mozApps.mgmt.onuninstall = null;
} }
}); });


Expand Down

0 comments on commit ee3accb

Please sign in to comment.