bug 860421 fix intermittent chatwindow test failure, r=felipe

This commit is contained in:
Shane Caraveo 2013-05-27 12:20:01 -07:00
Родитель a7f63b8156
Коммит 7210b1aa4b
1 изменённых файлов: 5 добавлений и 4 удалений

Просмотреть файл

@ -663,15 +663,16 @@ function resizeWindowToChatAreaWidth(desired, cb) {
}
// Otherwise we request resize and expect a resize event
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?
let newSize = window.SocialChatBar.chatbar.getBoundingClientRect().width;
let sizedOk = widthDeltaCloseEnough(newSize - desired);
if (!sizedOk) {
// not an error...
info("skipping this as we can't resize chat area to " + desired + " - got " + newSize);
return;
}
cb(sizedOk);
window.removeEventListener("resize", resize_handler);
executeSoon(function() {
cb(sizedOk);
});
});
window.resizeBy(delta, 0);
}