Skip to content

Commit

Permalink
Make BarTabUtils.findClosestLoadedTab() respect the browser.tabs.sele…
Browse files Browse the repository at this point in the history
…ctOwnerOnClose preference.

Closes #47
  • Loading branch information
philikon committed May 23, 2010
1 parent 798408f commit 73d6371
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions modules/prototypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,9 @@ BarTabHandler.prototype = {
}

// The most obvious choice would be the owner tab, if it's active.
if (aTab.owner && aTab.owner.getAttribute("ontap") != "true") {
if (aTab.owner
&& BarTabUtils.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")
&& aTab.owner.getAttribute("ontap") != "true") {
return aTab.owner;
}

Expand All @@ -374,7 +376,8 @@ BarTabHandler.prototype = {

// Fallback: there isn't an active tab available, so we're going
// to have to nominate a non-active one.
if (aTab.owner) {
if (aTab.owner
&& BarTabUtils.mPrefs.getBoolPref("browser.tabs.selectOwnerOnClose")) {
return aTab.owner;
}
if (aTab.nextSibling) {
Expand Down

0 comments on commit 73d6371

Please sign in to comment.