override ensureElementIsVisible() of the tab bar

This commit is contained in:
SHIMODA Hiroshi 2011-04-06 20:19:33 +09:00
parent b7c9a39951
commit 63106f2a7f

View File

@ -1209,6 +1209,26 @@ TreeStyleTabBrowser.prototype = {
)
);
}
/**
* The default implementation fails to scroll to tab if it is expanding.
* So we have to inject codes to override its effect.
*/
let (scrollbox = this.scrollBox) {
let source = scrollbox.ensureElementIsVisible.toSource();
if (source.indexOf('treeStyleTab') < 0) {
eval('scrollbox.ensureElementIsVisible = '+
source.replace(
'{',
<![CDATA[{
var treeStyleTab = TreeStyleTabService.getTabBrowserFromChild(this).treeStyleTab;
if (treeStyleTab && arguments[1])
return treeStyleTab.scrollToTab(arguments[0]);
]]>.toString()
)
);
}
}
},
_ensureNewSplitter : function TSTBrowser__ensureNewSplitter()