mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-28 19:38:13 +00:00
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:
parent
e17e6bd51c
commit
34625e042e
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user