Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Issue 5309: Issue with the Firebug.unregisterPanel()

  • Loading branch information...
commit 3c9483c07a1a11ca42571e635ec139539d4d18c7 1 parent 609df36
Jan Odvarko authored March 09, 2012
14  extension/content/firebug/chrome/chrome.js
@@ -841,7 +841,12 @@ var FirebugChrome =
841 841
     syncSidePanels: function()
842 842
     {
843 843
         if (FBTrace.DBG_PANELS)
844  
-            FBTrace.sysout("syncSidePanels "+panelBar1.selectedPanel);
  844
+        {
  845
+            FBTrace.sysout("chrome.syncSidePanels; main panel: " +
  846
+                (panelBar1.selectedPanel ? panelBar1.selectedPanel.name : "no panel") +
  847
+                ", side panel: " +
  848
+                (panelBar2.selectedPanel ? panelBar2.selectedPanel.name : "no panel"));
  849
+        }
845 850
 
846 851
         if (!panelBar1.selectedPanel)
847 852
             return;
@@ -871,9 +876,15 @@ var FirebugChrome =
871 876
             }
872 877
         }
873 878
         else
  879
+        {
874 880
             panelBar2.selectPanel(null);
  881
+        }
  882
+
  883
+        if (FBTrace.DBG_PANELS)
  884
+            FBTrace.sysout("chrome.syncSidePanels; selected side panel " + panelBar1.selectedPanel);
875 885
 
876 886
         sidePanelDeck.selectedPanel = panelBar2;
  887
+
877 888
         Dom.collapse(sidePanelDeck, !panelBar2.selectedPanel);
878 889
         Dom.collapse(panelSplitter, !panelBar2.selectedPanel);
879 890
     },
@@ -1671,7 +1682,6 @@ var FirebugChrome =
1671 1682
 
1672 1683
     appendToolbarButton: function(button, before)
1673 1684
     {
1674  
-        FBTrace.sysout("append Toolb button");
1675 1685
         var toolbar = FirebugChrome.$("fbPanelBar1-buttons");
1676 1686
         var element = Toolbar.createToolbarButton(toolbar, button, before);
1677 1687
         element.repObject = button;
15  extension/content/firebug/firebug.js
@@ -533,8 +533,17 @@ window.Firebug =
533 533
             panelTypeMap[arguments[i].prototype.name] = arguments[i];
534 534
 
535 535
         if (FBTrace.DBG_REGISTRATION)
  536
+        {
536 537
             for (var i = 0; i < arguments.length; ++i)
537  
-                FBTrace.sysout("registerPanel "+arguments[i].prototype.name+"\n");
  538
+                FBTrace.sysout("registerPanel "+arguments[i].prototype.name);
  539
+        }
  540
+
  541
+        // If Firebug is not initialized yet the UI will be updated automatically soon.
  542
+        if (!this.isInitialized)
  543
+            return;
  544
+
  545
+        Firebug.chrome.syncMainPanels();
  546
+        Firebug.chrome.syncSidePanels();
538 547
     },
539 548
 
540 549
     unregisterPanel: function(panelType)
@@ -579,6 +588,7 @@ window.Firebug =
579 588
 
580 589
         // The panel tab must be removed from the UI.
581 590
         Firebug.chrome.syncMainPanels();
  591
+        Firebug.chrome.syncSidePanels();
582 592
     },
583 593
 
584 594
     registerRep: function()
@@ -971,6 +981,9 @@ window.Firebug =
971 981
 
972 982
     getPanelTitle: function(panelType)
973 983
     {
  984
+        if (!panelType)
  985
+            return null;
  986
+
974 987
         return panelType.prototype.title ? panelType.prototype.title
975 988
             : Locale.$STR("Panel-"+panelType.prototype.name);
976 989
     },

0 notes on commit 3c9483c

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