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, a=Ian Neal, CTho git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_0_BRANCH@188081 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1360,16 +1360,22 @@
|
||||
<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.item(aDestIndex));
|
||||
|
||||
this.mCurrentTab.selected = true;
|
||||
|
||||
return tab;
|
||||
]]>
|
||||
</body>
|
||||
</method>
|
||||
|
||||
Reference in New Issue
Block a user