Brush up codes

This commit is contained in:
Piro / YUKI Hiroshi 2016-09-05 23:42:20 +09:00
parent bc0c05e1a5
commit ccbc8855e9

View File

@ -643,11 +643,12 @@ var TreeStyleTabWindowHelper = {
if (!scrollbox.__treestyletab__ensureElementIsVisible) {
scrollbox.__treestyletab__ensureElementIsVisible = scrollbox.ensureElementIsVisible;
scrollbox.ensureElementIsVisible = function(...aArgs) {
if (b.treeStyleTab.shouldCancelEnsureElementIsVisible())
var treeStyleTab = gBrowser.treeStyleTab;
if (treeStyleTab.shouldCancelEnsureElementIsVisible())
return;
let shouldScrollNow = aArgs[1] === false;
if (b.treeStyleTab.animationEnabled && !shouldScrollNow)
return b.treeStyleTab.scrollToTab(aArgs[0]);
if (treeStyleTab.animationEnabled && !shouldScrollNow)
return treeStyleTab.scrollToTab(aArgs[0]);
scrollbox.__treestyletab__ensureElementIsVisible.call(this, ...aArgs);
};
}