mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 608153 - stay on app tab when switching groups r=tim
This commit is contained in:
parent
3055030784
commit
8d5dc47a7a
@ -360,8 +360,10 @@ let TabView = {
|
||||
if (!tabItem)
|
||||
return;
|
||||
|
||||
// Switch to the new tab
|
||||
window.gBrowser.selectedTab = tabItem.tab;
|
||||
if (gBrowser.selectedTab.pinned)
|
||||
groupItems.updateActiveGroupItemAndTabBar(tabItem, {dontSetActiveTabInGroup: true});
|
||||
else
|
||||
gBrowser.selectedTab = tabItem.tab;
|
||||
});
|
||||
}
|
||||
}, true);
|
||||
|
@ -2472,10 +2472,14 @@ let GroupItems = {
|
||||
// ----------
|
||||
// Function: updateActiveGroupItemAndTabBar
|
||||
// Sets active TabItem and GroupItem, and updates tab bar appropriately.
|
||||
updateActiveGroupItemAndTabBar: function GroupItems_updateActiveGroupItemAndTabBar(tabItem) {
|
||||
// Parameters:
|
||||
// tabItem - the tab item
|
||||
// options - is passed to UI.setActive() directly
|
||||
updateActiveGroupItemAndTabBar:
|
||||
function GroupItems_updateActiveGroupItemAndTabBar(tabItem, options) {
|
||||
Utils.assertThrow(tabItem && tabItem.isATabItem, "tabItem must be a TabItem");
|
||||
|
||||
UI.setActive(tabItem);
|
||||
UI.setActive(tabItem, options);
|
||||
this._updateTabBar();
|
||||
},
|
||||
|
||||
|
@ -87,8 +87,9 @@ _BROWSER_FILES = \
|
||||
browser_tabview_bug606905.js \
|
||||
browser_tabview_bug607108.js \
|
||||
browser_tabview_bug608037.js \
|
||||
browser_tabview_bug608184.js \
|
||||
browser_tabview_bug608153.js \
|
||||
browser_tabview_bug608158.js \
|
||||
browser_tabview_bug608184.js \
|
||||
browser_tabview_bug608405.js \
|
||||
browser_tabview_bug610208.js \
|
||||
browser_tabview_bug610242.js \
|
||||
|
48
browser/components/tabview/test/browser_tabview_bug608153.js
Normal file
48
browser/components/tabview/test/browser_tabview_bug608153.js
Normal file
@ -0,0 +1,48 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
function test() {
|
||||
waitForExplicitFinish();
|
||||
|
||||
let pinnedTab = gBrowser.addTab();
|
||||
gBrowser.pinTab(pinnedTab);
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
gBrowser.unpinTab(pinnedTab);
|
||||
while (gBrowser.tabs[1])
|
||||
gBrowser.removeTab(gBrowser.tabs[1]);
|
||||
hideTabView();
|
||||
});
|
||||
|
||||
showTabView(function() {
|
||||
let cw = TabView.getContentWindow();
|
||||
let groupItemOne = cw.GroupItems.groupItems[0];
|
||||
let groupItemTwo = createGroupItemWithBlankTabs(window, 250, 250, 40, 1);
|
||||
|
||||
is(cw.GroupItems.groupItems.length, 2, "Two group items");
|
||||
|
||||
hideTabView(function() {
|
||||
gBrowser.selectedTab = pinnedTab;
|
||||
is(cw.GroupItems.getActiveGroupItem(), groupItemTwo, "Group two is active");
|
||||
is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
|
||||
|
||||
goToNextGroup();
|
||||
is(cw.GroupItems.getActiveGroupItem(), groupItemOne, "Group one is active");
|
||||
is(gBrowser.selectedTab, pinnedTab, "Selected tab is the pinned tab");
|
||||
|
||||
finish();
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function goToNextGroup() {
|
||||
let utils =
|
||||
QueryInterface(Ci.nsIInterfaceRequestor).
|
||||
getInterface(Ci.nsIDOMWindowUtils);
|
||||
|
||||
const masks = Ci.nsIDOMNSEvent;
|
||||
let mval = 0;
|
||||
mval |= masks.CONTROL_MASK;
|
||||
|
||||
utils.sendKeyEvent("keypress", 0, 96, mval);
|
||||
}
|
@ -466,7 +466,8 @@ let UI = {
|
||||
if (item.isATabItem) {
|
||||
if (item.parent)
|
||||
GroupItems.setActiveGroupItem(item.parent);
|
||||
this._setActiveTab(item);
|
||||
if (!options || !options.dontSetActiveTabInGroup)
|
||||
this._setActiveTab(item);
|
||||
} else {
|
||||
GroupItems.setActiveGroupItem(item);
|
||||
if (!options || !options.dontSetActiveTabInGroup) {
|
||||
|
Loading…
Reference in New Issue
Block a user