空のタブが1つだけあるときに閉じたタブを開き直すとタブバーの上端にスペースが空いてしまう問題を修正

git-svn-id: http://www.cozmixng.org/repos/piro/treestyletab/trunk@4415 599a83e7-65a4-db11-8015-0010dcdd6dc2
This commit is contained in:
piro 2009-05-12 17:35:06 +00:00
parent 62b8d17dec
commit cd6b63974b

View File

@ -3202,7 +3202,20 @@ TreeStyleTabBrowser.prototype = {
var radian = 90 * Math.PI / 180; var radian = 90 * Math.PI / 180;
var self = this; var self = this;
aTab.__treestyletab__updateTabCollapsedTask = function(aTime, aBeginning, aChange, aDuration) { aTab.__treestyletab__updateTabCollapsedTask = function(aTime, aBeginning, aChange, aDuration) {
if (aTime >= aDuration) { // If this is the last tab, negative scroll happens.
// Then, we shouldn't do animation.
var stopAnimation = false;
var scrollBox = self.scrollBox;
if (scrollBox) {
if (scrollBox._scrollbox) scrollBox = scrollBox._scrollbox;
if ('scrollTop' in scrollBox &&
(scrollBox.scrollTop < 0 || scrollBox.scrollLeft < 0)) {
scrollBox.scrollTop = 0;
scrollBox.scrollLeft = 0;
stopAnimation = true;
}
}
if (aTime >= aDuration || stopAnimation) {
delete aTab.__treestyletab__updateTabCollapsedTask; delete aTab.__treestyletab__updateTabCollapsedTask;
aTab.removeAttribute(self.kCOLLAPSING); aTab.removeAttribute(self.kCOLLAPSING);
if (aCollapsed) aTab.setAttribute(self.kCOLLAPSED_DONE, true); if (aCollapsed) aTab.setAttribute(self.kCOLLAPSED_DONE, true);