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

This commit is contained in:
sspitzer@mozilla.org 2007-08-21 22:01:28 -07:00
Родитель a80ea36cec
Коммит ae404b15fe
1 изменённых файлов: 11 добавлений и 4 удалений

Просмотреть файл

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