1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-21 00:17:59 +01:00

Simplify tabs.tabStrip definition.

This commit is contained in:
Doug Kearns
2009-06-08 22:31:26 +10:00
parent c6056f711f
commit cc60df5bb7

View File

@@ -40,6 +40,7 @@ function Tabs() //{{{
/////////////////////////////////////////////////////////////////////////////{{{ /////////////////////////////////////////////////////////////////////////////{{{
var tabmail; var tabmail;
// FIXME: doesn't belong here
var getBrowser = (function () { var getBrowser = (function () {
if (config.hostApplication == "Thunderbird") if (config.hostApplication == "Thunderbird")
{ {
@@ -60,15 +61,6 @@ function Tabs() //{{{
return window.getBrowser; return window.getBrowser;
})(); })();
// FIXME: why is this app specific conditional code here?
// Why the distinction? Why not just mStrip? --djk
if (config.hostApplication == "Firefox")
var tabStrip = getBrowser().mStrip.getElementsByClassName("tabbrowser-tabs")[0];
else if (/^(Thunderbird|Songbird)$/.test(config.hostApplication))
tabStrip = getBrowser().mStrip;
else
tabStrip = null;
var alternates = [getBrowser().mCurrentTab, null]; var alternates = [getBrowser().mCurrentTab, null];
// used for the "gb" and "gB" mappings to remember the last :buffer[!] command // used for the "gb" and "gB" mappings to remember the last :buffer[!] command
@@ -118,7 +110,8 @@ function Tabs() //{{{
services.get("sessionStore").setTabState(to, tabState); services.get("sessionStore").setTabState(to, tabState);
} }
// hide tabs initially to prevent flickering when 'stal' is unset // hide tabs initially to prevent flickering when 'stal' would hide them
// on startup
if (config.hasTabbrowser) if (config.hasTabbrowser)
getBrowser().mStrip.collapsed = true; getBrowser().mStrip.collapsed = true;
@@ -749,7 +742,7 @@ function Tabs() //{{{
/** /**
* @property {Object} The tab browser strip. * @property {Object} The tab browser strip.
*/ */
get tabStrip() tabStrip, get tabStrip() getBrowser().mStrip,
/** /**
* @property {Object[]} The array of closed tabs for the current * @property {Object[]} The array of closed tabs for the current