From 2afed25051e8dd269a601f72bd2fefc0b5a4fde9 Mon Sep 17 00:00:00 2001 From: "asqueella%gmail.com" Date: Wed, 22 Aug 2007 05:06:00 +0000 Subject: [PATCH] Bug 345741 - Improve "All Tabs" menu active/visible tab feedback p=Michael Ventnor r=mano --- browser/base/content/tabbrowser.xml | 32 ++++++++++++++++++++++++----- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/browser/base/content/tabbrowser.xml b/browser/base/content/tabbrowser.xml index 40adfa52b84..5db0db3fefa 100644 --- a/browser/base/content/tabbrowser.xml +++ b/browser/base/content/tabbrowser.xml @@ -2963,9 +2963,6 @@ @@ -3020,6 +3017,28 @@ case "TabOpen": this._createTabMenuItem(aEvent.originalTarget); break; + case "scroll": + this._updateTabsVisibilityStatus(); + break; + } + ]]> + + + + = tabstripBO.screenX && + curTabBO.screenX + curTabBO.width <= tabstripBO.screenX + tabstripBO.width) + this.childNodes[i].setAttribute("tabIsVisible", "true"); + else + this.childNodes[i].removeAttribute("tabIsVisible"); } ]]> @@ -3066,6 +3085,7 @@ // Listen for changes in the tab bar. var tabbrowser = document.getBindingParent(tabcontainer); tabbrowser.addEventListener("TabOpen", this, false); + tabcontainer.mTabstrip.addEventListener("scroll", this, false); // if an animation is in progress and the user // clicks on the "all tabs" button, stop the animation @@ -3074,6 +3094,7 @@ for (var i = 0; i < tabs.length; i++) { this._createTabMenuItem(tabs[i]); } + this._updateTabsVisibilityStatus(); ]]> @@ -3087,8 +3108,9 @@ menuItem.tab.mCorrespondingMenuitem = null; this.removeChild(menuItem); } - var tabbrowser = document.getBindingParent(document.getBindingParent(this)); - tabbrowser.removeEventListener("TabOpen", this, false); + var tabcontainer = document.getBindingParent(this); + tabcontainer.mTabstrip.removeEventListener("scroll", this, false); + document.getBindingParent(tabcontainer).removeEventListener("TabOpen", this, false); ]]>