fix for bug #343370. additional scenario where tab scrolling does not handle window resize well. cache the tab strip width and only adjust the tabstrip, scroll and ensure the selected tab is visible if the width changes. r=asaf

git-svn-id: svn://10.0.0.236/trunk@201479 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%mozilla.org
2006-07-03 06:46:48 +00:00
parent 750377def1
commit f6e363000b

View File

@@ -2414,14 +2414,21 @@
var self = this;
function onResize() {
self.adjustTabstrip(false);
self.mTabstrip.scrollBoxObject
.ensureElementIsVisible(self.selectedItem);
var width = self.mTabstrip.boxObject.width;
if (width != self.mTabstripWidth) {
self.adjustTabstrip(false);
self.mTabstrip.scrollByIndex(1);
self.mTabstrip.scrollBoxObject
.ensureElementIsVisible(self.selectedItem);
self.mTabstripWidth = width;
}
}
window.addEventListener("resize", onResize, false);
]]>
</constructor>
<field name="mTabstripWidth">0</field>
<field name="mTabstrip">
document.getAnonymousElementByAttribute(this, "anonid", "arrowscrollbox");
</field>
@@ -2563,7 +2570,7 @@
<handlers>
<handler event="TabOpen" action="this.adjustTabstrip(false);"/>
<handler event="TabClose" action="this.adjustTabstrip(true);"/>
<handler event="TabSelect" action="this._handleTabSelect()"/>
<handler event="TabSelect" action="this._handleTabSelect();"/>
</handlers>
</binding>