Bug 321490: Make SeaMonkey compatible again with moveTabTo implementation of the Firefox

If the first argument is a tab, look up its index. Return the tab we get from insertBefore().
r=CTho, sr=Neil
This commit is contained in:
jag%tty.nl 2006-01-23 03:43:16 +00:00
Родитель 0bc06dc978
Коммит cc87e734c5
1 изменённых файлов: 12 добавлений и 5 удалений

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

@ -1364,16 +1364,23 @@
<parameter name="aDestIndex"/>
<body>
<![CDATA[
// for compatibility with extensions
if (typeof(aSrcIndex) != "number")
aSrcIndex = this.getTabIndex(aSrcIndex);
this.mTabFilters.splice(aDestIndex, 0, this.mTabFilters.splice(aSrcIndex, 1)[0]);
this.mTabListeners.splice(aDestIndex, 0, this.mTabListeners.splice(aSrcIndex, 1)[0]);
aDestIndex = aDestIndex < aSrcIndex ? aDestIndex : aDestIndex + 1;
this.mCurrentTab.selected = false;
if (aDestIndex == this.mTabs.length)
this.mTabContainer.appendChild(this.mTabs[aSrcIndex]);
else
this.mTabContainer.insertBefore(this.mTabs[aSrcIndex], this.mTabs[aDestIndex]);
if (aDestIndex >= aSrcIndex)
++aDestIndex;
var tab = this.mTabContainer.insertBefore(this.mTabs[aSrcIndex],
this.mTabs[aDestIndex]);
this.mCurrentTab.selected = true;
return tab;
]]>
</body>
</method>