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'])
|
||||
clearTimeout(this.timers['onTabsOnTopSyncCommand']);
|
||||
this.timers['onTabsOnTopSyncCommand'] = setTimeout((function() {
|
||||
var cleanup = (function() {
|
||||
this.windowService.tabsOnTopChangingByUI = false;
|
||||
delete this.timers['onTabsOnTopSyncCommand'];
|
||||
}).bind(this);
|
||||
try {
|
||||
Deferred.resolve()
|
||||
.then((function() {
|
||||
this.windowService.toggleFixed(this.mTabBrowser);
|
||||
setTimeout((function() {
|
||||
try {
|
||||
return wait(0);
|
||||
}).bind(this))
|
||||
.then((function() {
|
||||
if (this.window.TabsOnTop.enabled != aEnabled)
|
||||
this.window.TabsOnTop.enabled = aEnabled;
|
||||
}
|
||||
catch(e) {
|
||||
this.defaultErrorHandler(e);
|
||||
}
|
||||
cleanup();
|
||||
}).bind(this), 0);
|
||||
}
|
||||
catch(e) {
|
||||
this.defaultErrorHandler(e);
|
||||
cleanup();
|
||||
}
|
||||
}).bind(this))
|
||||
.catch(this.defaultErrorHandler.bind(this))
|
||||
.then((function() {
|
||||
this.windowService.tabsOnTopChangingByUI = false;
|
||||
delete this.timers['onTabsOnTopSyncCommand'];
|
||||
}).bind(this));
|
||||
}).bind(this), 0);
|
||||
},
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user