mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 581078 - Get rid of Utils.activeTab to avoid iterating over all Tabs
Directly access gBrowser.selectedTab and compare other raw tabs against it until BrowserTab goes away. Get the reference to the BrowserTab instead of iterating over Tabs through .tabcandyBrowserTab.
This commit is contained in:
parent
6d2a905722
commit
81b6842558
@ -696,7 +696,7 @@ window.Group.prototype = iQ.extend(new Item(), new Subscribable(), {
|
||||
if (typeof(item.setResizable) == 'function')
|
||||
item.setResizable(false);
|
||||
|
||||
if (item.tab == Utils.activeTab)
|
||||
if (item.tab.raw == gBrowser.selectedTab)
|
||||
Groups.setActiveGroup(this);
|
||||
}
|
||||
|
||||
|
@ -745,7 +745,7 @@ window.TabItems = {
|
||||
if (group) {
|
||||
group.add(item);
|
||||
|
||||
if (item.tab == Utils.activeTab)
|
||||
if (item.tab.raw == gBrowser.selectedTab)
|
||||
Groups.setActiveGroup(item.parent);
|
||||
}
|
||||
}
|
||||
|
@ -625,7 +625,7 @@ function UIClass() {
|
||||
// Variable: currentTab
|
||||
// Keeps track of which <Tabs> tab we are currently on.
|
||||
// Used to facilitate zooming down from a previous tab.
|
||||
this.currentTab = Utils.activeTab;
|
||||
this.currentTab = gBrowser.selectedTab.tabcandyBrowserTab;
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
|
@ -523,27 +523,6 @@ window.Subscribable.prototype = {
|
||||
// Class: Utils
|
||||
// Singelton with common utility functions.
|
||||
var Utils = {
|
||||
// ___ Windows and Tabs
|
||||
|
||||
// ----------
|
||||
// Variable: activeTab
|
||||
// The <Tabs> tab that represents the active tab in the active window.
|
||||
get activeTab(){
|
||||
try {
|
||||
Utils.assert('tabBrowser', gBrowser);
|
||||
|
||||
var rawTab = gBrowser.selectedTab;
|
||||
for ( var i=0; i<Tabs.length; i++){
|
||||
if (Tabs[i].raw == rawTab)
|
||||
return Tabs[i];
|
||||
}
|
||||
} catch(e) {
|
||||
Utils.log(e);
|
||||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
// ___ Logging
|
||||
|
||||
// ----------
|
||||
|
Loading…
Reference in New Issue
Block a user