Index: chrome/content/ui/sidebar.js |
=================================================================== |
--- a/chrome/content/ui/sidebar.js |
+++ b/chrome/content/ui/sidebar.js |
@@ -89,17 +89,23 @@ function init() { |
wnd.setAttribute(attr, defaults[attr]); |
} |
let {addBrowserLocationListener} = require("appSupport"); |
updateContentLocation(); |
// Initialize matcher for disabled filters |
reloadDisabledFilters(); |
- FilterNotifier.addListener(reloadDisabledFilters); |
+ FilterNotifier.on("subscription.added", reloadDisabledFilters); |
+ FilterNotifier.on("subscription.removed", reloadDisabledFilters); |
+ FilterNotifier.on("subscription.disabled", reloadDisabledFilters); |
+ FilterNotifier.on("subscription.updated", reloadDisabledFilters); |
+ FilterNotifier.on("filter.added", reloadDisabledFilters); |
+ FilterNotifier.on("filter.removed", reloadDisabledFilters); |
+ FilterNotifier.on("filter.disabled", reloadDisabledFilters); |
Prefs.addListener(onPrefChange); |
// Activate flasher |
list.addEventListener("select", onSelectionChange, false); |
// Initialize data |
handleLocationChange(); |
@@ -140,17 +146,23 @@ function getFilter(item) |
return Filter.fromText(item.filter); |
else |
return null; |
} |
// To be called on unload |
function cleanUp() { |
requestNotifier.shutdown(); |
- FilterNotifier.removeListener(reloadDisabledFilters); |
+ FilterNotifier.off("subscription.added", reloadDisabledFilters); |
+ FilterNotifier.off("subscription.removed", reloadDisabledFilters); |
+ FilterNotifier.off("subscription.disabled", reloadDisabledFilters); |
+ FilterNotifier.off("subscription.updated", reloadDisabledFilters); |
+ FilterNotifier.off("filter.added", reloadDisabledFilters); |
+ FilterNotifier.off("filter.removed", reloadDisabledFilters); |
+ FilterNotifier.off("filter.disabled", reloadDisabledFilters); |
Prefs.removeListener(onPrefChange); |
E("list").view = null; |
let {removeBrowserLocationListener} = require("appSupport"); |
if (removeBrowserLocationListener) |
removeBrowserLocationListener(mainWin, handleLocationChange); |
mainWin.removeEventListener("unload", mainUnload, false); |
} |