зеркало из https://github.com/mozilla/pjs.git
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:
Родитель
0bc06dc978
Коммит
cc87e734c5
|
@ -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>
|
||||
|
|
Загрузка…
Ссылка в новой задаче