Merge remote-tracking branch 'origin/master' into custom

This commit is contained in:
Roy Tam 2020-02-07 09:41:49 +08:00
commit a60c742310
14 changed files with 33 additions and 308 deletions

View file

@ -216,6 +216,24 @@ var ctrlTab = {
}
}
let hidePinnedTabs = gPrefService.getBoolPref("browser.ctrlTab.hidePinnedTabs");
if (hidePinnedTabs) {
regularTabsList = list.filter(function (tab) !tab.pinned);
// Don't hide pinned tabs if we only have 1 regular tab
if (regularTabsList.length > 1) {
list = regularTabsList;
}
}
let hidePinnedTabs = gPrefService.getBoolPref("browser.ctrlTab.hidePinnedTabs");
if (hidePinnedTabs) {
regularTabsList = list.filter(function (tab) !tab.pinned);
// Don't hide pinned tabs if we only have 1 regular tab
if (regularTabsList.length > 1) {
list = regularTabsList;
}
}
return this._tabList = list;
},
@ -649,6 +667,15 @@ var allTabs = {
this._currentFilter = this.filterField.value;
let hidePinnedTabs = gPrefService.getBoolPref("browser.allTabs.hidePinnedTabs");
if (hidePinnedTabs) {
let regularTabsList = Array.filter(this.previews, function (preview) !preview._tab.pinned);
// Show pinned tabs if we don't have any regular tabs
if (regularTabsList.length == 0) {
hidePinnedTabs = false;
}
}
var filter = this._currentFilter.split(/\s+/g);
this._visible = 0;
Array.forEach(this.previews, function (preview) {
@ -663,7 +690,7 @@ var allTabs = {
for (let i = 0; i < filter.length; i++)
matches += tabstring.includes(filter[i]);
}
if (matches < filter.length || tab.hidden) {
if (matches < filter.length || tab.hidden || (hidePinnedTabs && tab.pinned)) {
preview.hidden = true;
}
else {