Bug 982752 - Error: childNodes.lastChild is undefined Source file: chrome://editor/content/editor.js Line: 2756. r=IanN

CLOSED TREE
This commit is contained in:
Sebastian Hengst 2014-03-18 00:05:39 +01:00
Родитель 015d1e7c73
Коммит fa5c6a7df9
1 изменённых файлов: 3 добавлений и 6 удалений

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

@ -2747,12 +2747,9 @@ function UpdateStructToolbar()
var toolbar = document.getElementById("structToolbar");
if (!toolbar) return;
var childNodes = toolbar.childNodes;
// We need to leave the <label> to flex the buttons to the left
// so, don't remove the last child at position length - 1
while (childNodes.length > 1) {
// Remove back to front so there's less moving about.
childNodes.lastChild.previousSibling.remove();
// We need to leave the <label> to flex the buttons to the left.
for (let node of toolbar.querySelectorAll("toolbarbutton")) {
node.remove();
}
toolbar.removeAttribute("label");