зеркало из https://github.com/mozilla/gecko-dev.git
Bug 960309, make browser_tabview_bug625269.js more reliable, r=roc
--HG-- extra : rebase_source : 0a5ac4d8578ea73d1fc0d6a5c6e90651a1a4418d
This commit is contained in:
Родитель
9910bea99a
Коммит
f593bb23c9
|
@ -64,14 +64,13 @@ function resizeWindow(win, diffX, diffY, callback) {
|
|||
let targetWidth = win.outerWidth + diffX;
|
||||
let targetHeight = win.outerHeight + diffY;
|
||||
|
||||
win.addEventListener("resize", function onResize() {
|
||||
(function tryResize() {
|
||||
let {outerWidth: width, outerHeight: height} = win;
|
||||
if (width != targetWidth || height != targetHeight)
|
||||
return;
|
||||
|
||||
win.removeEventListener("resize", onResize, false);
|
||||
executeSoon(callback);
|
||||
}, false);
|
||||
|
||||
win.resizeBy(diffX, diffY);
|
||||
if (width != targetWidth || height != targetHeight) {
|
||||
win.resizeTo(targetWidth, targetHeight);
|
||||
executeSoon(tryResize);
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче