Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5427: Firebug menu added several times with same ids

  • Loading branch information...
commit f2b23d0ec2ac886418032fd66f040bfbfeea0ad9 1 parent cc91b03
Jan Odvarko authored July 05, 2012
3  extension/content/firebug/chrome/chrome.js
@@ -1056,6 +1056,9 @@ var FirebugChrome =
1056 1056
     updateOrient: function(value)
1057 1057
     {
1058 1058
         var panelPane = FirebugChrome.$("fbPanelPane");
  1059
+        if (!panelPane)
  1060
+            return;
  1061
+
1059 1062
         var newOrient = value ? "vertical" : "horizontal";
1060 1063
         if (panelPane.orient == newOrient)
1061 1064
             return;
14  extension/content/firebug/firefox/browserOverlay.js
@@ -361,6 +361,9 @@ Firebug.GlobalUI =
361 361
         if (popup.state == "open")
362 362
             return;
363 363
 
  364
+        while (popup.lastChild)
  365
+            popup.removeChild(popup.lastChild);
  366
+
364 367
         // Generate dynamic content.
365 368
         for (var i=0; i<firebugMenuContent.length; i++)
366 369
             popup.appendChild(firebugMenuContent[i].cloneNode(true));
@@ -412,7 +415,7 @@ Firebug.GlobalUI =
412 415
             closeFirebug.setAttribute("collapsed", (Firebug.currentContext ? "false" : "true"));
413 416
         }
414 417
 
415  
-        // Allow customizing of Firebug menu (see FBTest and FBTrace).
  418
+        // Allow Firebug menu customization (see FBTest and FBTrace as an example).
416 419
         var event = new CustomEvent("firebugMenuShowing", {detail: popup});
417 420
         document.dispatchEvent(event);
418 421
     },
@@ -422,8 +425,13 @@ Firebug.GlobalUI =
422 425
         if (popup.state == "open")
423 426
             return;
424 427
 
425  
-        while (popup.lastChild)
426  
-            popup.removeChild(popup.lastChild);
  428
+        // xxxHonza: I don't know why the timeout must be here, but if it isn't
  429
+        // the icon menu is broken (see issue 5427)
  430
+        setTimeout(function()
  431
+        {
  432
+            while (popup.lastChild)
  433
+                popup.removeChild(popup.lastChild);
  434
+        });
427 435
     },
428 436
 
429 437
     onPositionPopupShowing: function(popup)
2  extension/content/firebug/lib/options.js
@@ -229,7 +229,7 @@ var Options =
229 229
 
230 230
     togglePref: function(name)
231 231
     {
232  
-        this.setPref(Options.prefDomain, name, !Firebug[name]);
  232
+        this.set(name, !this.get(name));
233 233
     },
234 234
 
235 235
     get: function(name)

0 notes on commit f2b23d0

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