Don't run animation without window (to fix a regression: all animation effect was unexpectedly stopped after the configuration dialog is opened)

This commit is contained in:
Piro / YUKI Hiroshi 2012-11-12 03:28:40 +09:00
parent af1975d073
commit 9a27aba8d8

View File

@ -72,7 +72,10 @@ if (typeof window == 'undefined' ||
addTask : function(aTask, aBeginningValue, aTotalChange, aDuration, aRelatedWindow) addTask : function(aTask, aBeginningValue, aTotalChange, aDuration, aRelatedWindow)
{ {
if (!aTask) return; if (!aRelatedWindow && window instanceof Ci.nsIDOMWindow)
aRelatedWindow = window;
if (!aTask || !aRelatedWindow) return;
if (this._windows.indexOf(aRelatedWindow) < 0) if (this._windows.indexOf(aRelatedWindow) < 0)
this._windows.push(aRelatedWindow); this._windows.push(aRelatedWindow);
@ -147,8 +150,8 @@ if (typeof window == 'undefined' ||
{ {
let w = this._windows[i]; let w = this._windows[i];
if (this.tasks.some(function(aTask) { if (this.tasks.some(function(aTask) {
return aTask && aTask.window && this._windows.indexOf(aTask.window) > -1; return aTask && aTask.window == w;
}, this)) }))
continue; continue;
let index = this._animatingWindows.indexOf(w); let index = this._animatingWindows.indexOf(w);
@ -181,8 +184,8 @@ if (typeof window == 'undefined' ||
{ {
let task = this.tasks[i]; let task = this.tasks[i];
try { try {
if (task) { if (task && !task.window.closed) {
if (aWindow && task.window != aWindow) if (task.window != aWindow)
continue; continue;
let time = Math.min(task.duration, now - task.start); let time = Math.min(task.duration, now - task.start);
let finished = task.task( let finished = task.task(