[Pkg-mozext-commits] [requestpolicy] 30/280: update subscriptions.html on changes in other tabs

David Prévot taffit at moszumanska.debian.org
Sat May 2 20:29:56 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository requestpolicy.

commit b124e1f94500834c372eab27611ddb7af0730ae4
Author: Martin Kimmerle <dev at 256k.de>
Date:   Tue Nov 25 22:10:56 2014 +0100

    update subscriptions.html on changes in other tabs
    
    ... just like for other preferences, see commit 576d09d
---
 src/content/settings/subscriptions.js | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git a/src/content/settings/subscriptions.js b/src/content/settings/subscriptions.js
index 6854cc0..37eb226 100644
--- a/src/content/settings/subscriptions.js
+++ b/src/content/settings/subscriptions.js
@@ -71,7 +71,6 @@ function updateDisplay() {
   var userSubs = rpService._subscriptions;
   var subsInfo = userSubs.getSubscriptionInfo();
   var allSubElements = getAllSubscriptionElements();
-  debugger;
   for (var i = 0, len = allSubElements.length; i < len; ++i) {
     var element = allSubElements[i];
     element.input.checked = (element.id in subsInfo['official']);
@@ -127,11 +126,13 @@ function onload() {
     el.addEventListener('change', handleSubscriptionCheckboxChange);
   }
 
-  prefsChangedObserver = new common.PrefsChangedObserver(
-      function(subject, topic, data) {
-        updateDisplay();
-      });
+  subAddedObserver = new common.Observer(updateDisplay,
+                                         SUBSCRIPTION_ADDED_TOPIC);
+  subRemovedObserver = new common.Observer(updateDisplay,
+                                           SUBSCRIPTION_REMOVED_TOPIC);
+
   window.addEventListener("beforeunload", function(event) {
-    prefsChangedObserver.unregister();
+    subAddedObserver.unregister();
+    subRemovedObserver.unregister();
   });
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/requestpolicy.git



More information about the Pkg-mozext-commits mailing list