Bug 247116: fix infinite resize loop that causes the UI to jitter when the bookmarks toolbar is empty, patch by Dave Townsend <mossop.bugzilla@blueprintit.co.uk>, r=me

This commit is contained in:
gavin%gavinsharp.com 2007-03-20 01:14:26 +00:00
parent 405d600298
commit 15e056867b

View File

@ -974,6 +974,7 @@ var BookmarksToolbar =
resizeFunc: function(event)
{
BookmarksToolbarRDFObserver._overflowTimerInEffect = false;
if (event && event.type == 'focus')
window.removeEventListener('focus', BookmarksToolbar.resizeFunc, false); // hack for bug 266737
var buttons = document.getElementById("bookmarks-ptf");
@ -988,6 +989,11 @@ var BookmarksToolbar =
return;
}
if (buttons.childNodes.length == 0) {
chevron.collapsed = true;
return;
}
var chevronWidth = 0;
chevron.collapsed = false;
chevronWidth = chevron.boxObject.width;
@ -1015,7 +1021,6 @@ var BookmarksToolbar =
}
usedWidth += button.boxObject.width;
}
BookmarksToolbarRDFObserver._overflowTimerInEffect = false;
},
// Fill in tooltips for personal toolbar