Browse files

Issue 5231: 'Deactivate Firebug' is shown even when Firebug is alread…

…y deactivated
  • Loading branch information...
1 parent d834b43 commit efc4e11aa353ad6ece857a6c24785c983efa5685 @janodvarko janodvarko committed Mar 28, 2012
Showing with 28 additions and 16 deletions.
  1. +25 −16 extension/content/firebug/firefox/browserOverlay.js
  2. +3 −0 extension/locale/en-US/firebug.properties
View
41 extension/content/firebug/firefox/browserOverlay.js
@@ -341,32 +341,41 @@ Firebug.GlobalUI =
onMenuShowing: function(popup)
{
- var currPos = FirebugLoader.getPref("framePosition");
- var detachFirebug = document.getElementById("menu_detachFirebug");
- if (detachFirebug)
+ var collapsed = "true";
+ if (Firebug.chrome)
{
- detachFirebug.setAttribute("label", (currPos == "detached" ?
- Locale.$STR("firebug.AttachFirebug") : Locale.$STR("firebug.DetachFirebug")));
+ var fbContentBox = Firebug.chrome.$("fbContentBox");
+ collapsed = fbContentBox.getAttribute("collapsed");
}
+ var currPos = FirebugLoader.getPref("framePosition");
+ var placement = Firebug.getPlacement ? Firebug.getPlacement() : "";
+
// Switch between "Open Firebug" and "Hide Firebug" label in the popup menu
- // (use the menu, which is just showing).
var toggleFirebug = popup.querySelector("#menu_toggleFirebug");
if (toggleFirebug)
{
- var collapsed = "true";
- if (Firebug.chrome)
+ var hiddenUI = (collapsed == "true" || placement == "minimized");
+ toggleFirebug.setAttribute("label", (hiddenUI ?
+ Locale.$STR("firebug.ShowFirebug") : Locale.$STR("firebug.HideFirebug")));
+
+ toggleFirebug.setAttribute("tooltiptext", (hiddenUI ?
+ Locale.$STR("firebug.menu.tip.Open_Firebug") :
+ Locale.$STR("firebug.menu.tip.Minimize_Firebug")));
+
+ // If Firebug is detached, use "Focus Firebug Window" label
+ if (currPos == "detached" && Firebug.currentContext)
{
- var fbContentBox = Firebug.chrome.$("fbContentBox");
- collapsed = fbContentBox.getAttribute("collapsed");
+ toggleFirebug.setAttribute("label", Locale.$STR("firebug.FocusFirebug"));
+ toggleFirebug.setAttribute("tooltiptext", Locale.$STR("firebug.menu.tip.Focus_Firebug"));
}
+ }
- toggleFirebug.setAttribute("label", (collapsed == "true" ?
- Locale.$STR("firebug.ShowFirebug") : Locale.$STR("firebug.HideFirebug")));
-
- // If Firebug is detached, hide the menu ('Open Firebug' shortcut doesn't hide,
- // but just focuses the external window)
- toggleFirebug.setAttribute("collapsed", (currPos == "detached" ? "true" : "false"));
+ // Hide "Deactivate Firebug" menu if Firebug is not active.
+ var closeFirebug = popup.querySelector("#menu_closeFirebug");
+ if (closeFirebug)
+ {
+ closeFirebug.setAttribute("collapsed", (Firebug.currentContext ? "false" : "true"));
}
},
View
3 extension/locale/en-US/firebug.properties
@@ -1020,6 +1020,9 @@ firebug.ShowFirebug=Open Firebug
firebug.menu.tip.Open_Firebug=Show the Firebug UI
firebug.HideFirebug=Hide Firebug
firebug.menu.tip.Minimize_Firebug=Minimize Firebug, but keep it active
+firebug.FocusFirebug=Focus Firebug Window
+firebug.menu.tip.Focus_Firebug=Focus Detached Firebug Window
+
firebug.menu.Enable_All_Panels=Enable All Panels
firebug.menu.tip.Enable_All_Panels=Enable all activable panels
firebug.menu.Disable_All_Panels=Disable All Panels

0 comments on commit efc4e11

Please sign in to comment.