Flatten deeply nested "setTimeout()"
This commit is contained in:
parent
e0a7e43b3c
commit
9be3c3493d
@ -4981,27 +4981,20 @@ TreeStyleTabBrowser.prototype = inherit(TreeStyleTabWindow.prototype, {
|
|||||||
if (this.timers['onTabsOnTopSyncCommand'])
|
if (this.timers['onTabsOnTopSyncCommand'])
|
||||||
clearTimeout(this.timers['onTabsOnTopSyncCommand']);
|
clearTimeout(this.timers['onTabsOnTopSyncCommand']);
|
||||||
this.timers['onTabsOnTopSyncCommand'] = setTimeout((function() {
|
this.timers['onTabsOnTopSyncCommand'] = setTimeout((function() {
|
||||||
var cleanup = (function() {
|
Deferred.resolve()
|
||||||
this.windowService.tabsOnTopChangingByUI = false;
|
.then((function() {
|
||||||
delete this.timers['onTabsOnTopSyncCommand'];
|
|
||||||
}).bind(this);
|
|
||||||
try {
|
|
||||||
this.windowService.toggleFixed(this.mTabBrowser);
|
this.windowService.toggleFixed(this.mTabBrowser);
|
||||||
setTimeout((function() {
|
return wait(0);
|
||||||
try {
|
}).bind(this))
|
||||||
|
.then((function() {
|
||||||
if (this.window.TabsOnTop.enabled != aEnabled)
|
if (this.window.TabsOnTop.enabled != aEnabled)
|
||||||
this.window.TabsOnTop.enabled = aEnabled;
|
this.window.TabsOnTop.enabled = aEnabled;
|
||||||
}
|
}).bind(this))
|
||||||
catch(e) {
|
.catch(this.defaultErrorHandler.bind(this))
|
||||||
this.defaultErrorHandler(e);
|
.then((function() {
|
||||||
}
|
this.windowService.tabsOnTopChangingByUI = false;
|
||||||
cleanup();
|
delete this.timers['onTabsOnTopSyncCommand'];
|
||||||
}).bind(this), 0);
|
}).bind(this));
|
||||||
}
|
|
||||||
catch(e) {
|
|
||||||
this.defaultErrorHandler(e);
|
|
||||||
cleanup();
|
|
||||||
}
|
|
||||||
}).bind(this), 0);
|
}).bind(this), 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user