Skip to content
Browse files

change made to fixing issue 4153

  • Loading branch information...
1 parent 3ca435f commit 959fca5e552520ff13f432133765c4b93e2723be @farshidbeheshti farshidbeheshti committed Jun 13, 2012
Showing with 32 additions and 8 deletions.
  1. +32 −8 extension/content/firebug/firebug.js
View
40 extension/content/firebug/firebug.js
@@ -776,15 +776,12 @@ window.Firebug =
{
if (panelName)
Firebug.chrome.selectPanel(panelName);
- var webApp = Firebug.connection.getCurrentSelectedWebApp();
- var context = Firebug.connection.getContextByWebApp(webApp);
- if (!context) // then we are not debugging the selected tab
- {
- context = Firebug.connection.getOrCreateContextByWebApp(webApp);
- forceOpen = true; // Be sure the UI is open for a newly created context
- }
- else // we were debugging
+
+ if (!Firebug.currentContext)
{
+ var context = Firebug.getContext();
+ // Be sure the UI is open for a newly created context.
+ forceOpen = true;
}
if (Firebug.isDetached())
@@ -817,6 +814,21 @@ window.Firebug =
},
/**
+ * Get context for the current website
+ */
+ getContext: function()
+ {
+ var webApp = Firebug.connection.getCurrentSelectedWebApp();
+ var context = Firebug.connection.getContextByWebApp(webApp);
+ // we are not debugging the selected tab.
+ if (!context)
+ {
+ context = Firebug.connection.getOrCreateContextByWebApp(webApp);
+ }
+ return context;
+ },
+
+ /**
* Primary function to re-show firebug due to visiting active site.
* Unlike toggleBar, we are trying to obey the current placement, not change it.
*/
@@ -885,6 +897,7 @@ window.Firebug =
// detached -> closed; inBrowser -> detached TODO reattach
toggleDetachBar: function(forceOpen, reopenInBrowser)
{
+
//detached -> inbrowser
if (!forceOpen && Firebug.isDetached())
{
@@ -893,9 +906,20 @@ window.Firebug =
topWin.close();
if (reopenInBrowser)
+ {
+ // Is Firebug deactivated ? if yes, should be
+ // activated first, then unminimize.
+ if (!Firebug.currentContext)
+ {
+ var context = Firebug.getContext();
+ }
Firebug.unMinimize();
+ }
else
+ {
Firebug.minimizeBar();
+ }
+
Firebug.chrome.syncPositionPref();
}
// is minimized now but the last time that has been closed, was in detached mode,

0 comments on commit 959fca5

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