Bug 1506240 - Port bug 1506063: Simplify gDragSpaceObserver. r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Fri, 09 Nov 2018 21:35:52 +0100
changeset 33685 6624bbe8579165a2866c406f7e6822b7dbb3965d
parent 33684 6c2e0403281d6cb7babeceaade2c54227363402a
child 33686 1240ce035b2ee488d21950802bea30c5ba40f02d
push id388
push userclokep@gmail.com
push dateMon, 28 Jan 2019 20:54:56 +0000
reviewersjorgk
bugs1506240, 1506063
Bug 1506240 - Port bug 1506063: Simplify gDragSpaceObserver. r=jorgk
mail/base/content/msgMail3PaneWindow.js
--- a/mail/base/content/msgMail3PaneWindow.js
+++ b/mail/base/content/msgMail3PaneWindow.js
@@ -2081,33 +2081,25 @@ function onTitlebarMaxClick() {
 }
 
 // Adds additional drag space to the window by listening to
 // the corresponding preference.
 var gDragSpaceObserver = {
   pref: "mail.tabs.extraDragSpace",
 
   init() {
-    this.update();
     Services.prefs.addObserver(this.pref, this);
+    this.observe();
   },
 
   uninit() {
     Services.prefs.removeObserver(this.pref, this);
   },
 
-  observe(aSubject, aTopic, aPrefName) {
-    if (aTopic != "nsPref:changed" || aPrefName != this.pref) {
-      return;
-    }
-
-    this.update();
-  },
-
-  update() {
+  observe() {
     if (Services.prefs.getBoolPref(this.pref)) {
       document.documentElement.setAttribute("extradragspace", "true");
     } else {
       document.documentElement.removeAttribute("extradragspace");
     }
     TabsInTitlebar.update();
   },
 };