Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5854: Enable + disable of options doesn't always take effect

  • Loading branch information...
commit 3beb0c78cde97ba1ac6be42f28669bd92506eef6 1 parent 4c68782
Simon Lindholm authored August 22, 2012
17  extension/content/firebug/chrome/reps.js
@@ -285,6 +285,7 @@ FirebugReps.Func = domplate(Firebug.Rep,
285 285
         var monitored = scriptInfo ? FBS.fbs.isMonitored(scriptInfo.sourceFile.href,
286 286
             scriptInfo.lineNo) : false;
287 287
 
  288
+        var self = this;
288 289
         var name = script ? StackFrame.getFunctionName(script, context) : fn.name;
289 290
         return [
290 291
             {
@@ -293,7 +294,11 @@ FirebugReps.Func = domplate(Firebug.Rep,
293 294
                 nol10n: true,
294 295
                 type: "checkbox",
295 296
                 checked: monitored,
296  
-                command: Obj.bindFixed(this.monitor, this, fn, monitored)
  297
+                command: function()
  298
+                {
  299
+                    var checked = this.hasAttribute("checked");
  300
+                    self.monitor(fn, !checked);
  301
+                }
297 302
             },
298 303
             "-",
299 304
             {
@@ -1107,7 +1112,6 @@ FirebugReps.Element = domplate(Firebug.Rep,
1107 1112
     getContextMenuItems: function(elt, target, context)
1108 1113
     {
1109 1114
         var type;
1110  
-        var monitored = EventMonitor.areEventsMonitored(elt, null, context);
1111 1115
         var items = [];
1112 1116
 
1113 1117
         if (Xml.isElementHTML(elt) || Xml.isElementXHTML(elt))
@@ -1173,9 +1177,12 @@ FirebugReps.Element = domplate(Firebug.Rep,
1173 1177
                 tooltiptext: "html.tip.Show_Events_In_Console",
1174 1178
                 id: "fbShowEventsInConsole",
1175 1179
                 type: "checkbox",
1176  
-                checked: monitored,
1177  
-                command: Obj.bindFixed(EventMonitor.toggleMonitorEvents,
1178  
-                    EventMonitor, elt, null, monitored, context)
  1180
+                checked: EventMonitor.areEventsMonitored(elt, null, context),
  1181
+                command: function()
  1182
+                {
  1183
+                    var checked = this.hasAttribute("checked");
  1184
+                    EventMonitor.toggleMonitorEvents(elt, null, !checked, context);
  1185
+                }
1179 1186
             },
1180 1187
             "-",
1181 1188
             {
7  extension/content/firebug/console/consolePanel.js
@@ -294,8 +294,11 @@ Firebug.ConsolePanel.prototype = Obj.extend(Firebug.ActivablePanel,
294 294
             type: "checkbox",
295 295
             checked: strictValue,
296 296
             tooltiptext: "console.option.tip.Show_Strict_Warnings",
297  
-            command: Obj.bindFixed(Options.setPref, Options,
298  
-                strictDomain, strictName, !strictValue)
  297
+            command: function()
  298
+            {
  299
+                var checked = this.hasAttribute("checked");
  300
+                Options.setPref(strictDomain, strictName, checked);
  301
+            }
299 302
         };
300 303
     },
301 304
 
8  extension/content/firebug/cookies/menuUtils.js
@@ -13,13 +13,17 @@ var MenuUtils =
13 13
 {
14 14
     optionMenu: function(context, label, tooltiptext, domain, option)
15 15
     {
16  
-        var value = Options.getPref(domain, option);
  16
+        var value = Options.getPref(domain, option), self = this;
17 17
         return {
18 18
             label: label,
19 19
             tooltiptext: tooltiptext,
20 20
             type: "checkbox",
21 21
             checked: value,
22  
-            command: Obj.bindFixed(this.setPref, this, domain, option, !value)
  22
+            command: function()
  23
+            {
  24
+                var checked = this.hasAttribute("checked");
  25
+                self.setPref(domain, option, checked);
  26
+            }
23 27
         };
24 28
     },
25 29
 
12  extension/content/firebug/js/scriptPanel.js
@@ -1376,8 +1376,14 @@ Firebug.ScriptPanel.prototype = Obj.extend(Firebug.SourceBoxPanel,
1376 1376
     optionMenu: function(label, option)
1377 1377
     {
1378 1378
         var checked = Firebug.Options.get(option);
1379  
-        return {label: label, type: "checkbox", checked: checked,
1380  
-            command: Obj.bindFixed(Firebug.Options.set, Firebug, option, !checked) };
  1379
+        return {
  1380
+            label: label, type: "checkbox", checked: checked,
  1381
+            command: function()
  1382
+            {
  1383
+                var checked = this.hasAttribute("checked");
  1384
+                Firebug.Options.set(option, checked)
  1385
+            }
  1386
+        };
1381 1387
     },
1382 1388
 
1383 1389
     getContextMenuItems: function(fn, target)
@@ -1970,4 +1976,4 @@ Firebug.registerPanel(Firebug.ScriptPanel);
1970 1976
 return Firebug.ScriptPanel;
1971 1977
 
1972 1978
 // ********************************************************************************************* //
1973  
-});
  1979
+});
2  extension/content/firebug/net/netPanel.js
@@ -312,7 +312,7 @@ NetPanel.prototype = Obj.extend(Firebug.ActivablePanel,
312 312
             tooltiptext: "net.option.tip.Disable_Browser_Cache",
313 313
             command: function()
314 314
             {
315  
-                BrowserCache.toggle(!this.getAttribute("checked"));
  315
+                BrowserCache.toggle(!this.hasAttribute("checked"));
316 316
             }
317 317
         };
318 318
     },

0 notes on commit 3beb0c7

Please sign in to comment.
Something went wrong with that request. Please try again.