Skip to content

Commit

Permalink
change made to fixing issue 4153
Browse files Browse the repository at this point in the history
  • Loading branch information
farshidbeheshti committed Jun 13, 2012
1 parent 3ca435f commit 959fca5
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions extension/content/firebug/firebug.js
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down Expand Up @@ -816,6 +813,21 @@ window.Firebug =
return true;
},

/**
* 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.
Expand Down Expand Up @@ -885,6 +897,7 @@ window.Firebug =
// detached -> closed; inBrowser -> detached TODO reattach
toggleDetachBar: function(forceOpen, reopenInBrowser)
{

//detached -> inbrowser
if (!forceOpen && Firebug.isDetached())
{
Expand All @@ -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,
Expand Down

0 comments on commit 959fca5

Please sign in to comment.