Bug 191637 Customize Toolbar Bustage. patch by Boris Zbarsky.

This commit is contained in:
chanial%noos.fr 2003-02-20 02:09:27 +00:00
parent f2bc384b60
commit cf728cada2

View File

@ -213,8 +213,8 @@ function wrapToolbarItems()
function unwrapToolbarItems()
{
var paletteItems = gToolbox.getElementsByTagName("toolbarpaletteitem");
for (var i = 0; i < paletteItems.length; ++i) {
var paletteItem = paletteItems[i];
var paletteItem;
while ((paletteItem = paletteItems.item(0)) != null) {
var toolbarItem = paletteItem.firstChild;
if (paletteItem.hasAttribute("itemdisabled"))
@ -223,6 +223,8 @@ function unwrapToolbarItems()
if (paletteItem.hasAttribute("itemcommand"))
toolbarItem.setAttribute("command", paletteItem.getAttribute("itemcommand"));
// We need the removeChild here because replaceChild and XBL no workee
// together. See bug 193298.
paletteItem.removeChild(toolbarItem);
paletteItem.parentNode.replaceChild(toolbarItem, paletteItem);
}