зеркало из https://github.com/mozilla/gecko-dev.git
bug 860421 fix intermittent chatwindow test failure, r=felipe
This commit is contained in:
Родитель
a7f63b8156
Коммит
7210b1aa4b
|
@ -663,15 +663,16 @@ function resizeWindowToChatAreaWidth(desired, cb) {
|
||||||
}
|
}
|
||||||
// Otherwise we request resize and expect a resize event
|
// Otherwise we request resize and expect a resize event
|
||||||
window.addEventListener("resize", function resize_handler() {
|
window.addEventListener("resize", function resize_handler() {
|
||||||
window.removeEventListener("resize", resize_handler);
|
|
||||||
// we did resize - but did we get far enough to be able to continue?
|
// we did resize - but did we get far enough to be able to continue?
|
||||||
let newSize = window.SocialChatBar.chatbar.getBoundingClientRect().width;
|
let newSize = window.SocialChatBar.chatbar.getBoundingClientRect().width;
|
||||||
let sizedOk = widthDeltaCloseEnough(newSize - desired);
|
let sizedOk = widthDeltaCloseEnough(newSize - desired);
|
||||||
if (!sizedOk) {
|
if (!sizedOk) {
|
||||||
// not an error...
|
return;
|
||||||
info("skipping this as we can't resize chat area to " + desired + " - got " + newSize);
|
|
||||||
}
|
}
|
||||||
cb(sizedOk);
|
window.removeEventListener("resize", resize_handler);
|
||||||
|
executeSoon(function() {
|
||||||
|
cb(sizedOk);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
window.resizeBy(delta, 0);
|
window.resizeBy(delta, 0);
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче