bug 94590, remove dup entries from wallet preview dialog, r=law, sr=alecf

This commit is contained in:
morse%netscape.com 2001-09-26 20:40:11 +00:00
parent 7fb75487be
commit a3cdd91c11

View File

@ -56,7 +56,20 @@ function Startup() {
menuItem.setAttribute("selected", "true");
}
menuItem.setAttribute("label", prefillList[i+2]);
menuPopup.appendChild(menuItem);
/* avoid making duplicate entries in the same menulist */
var child = menuPopup.firstChild;
var alreadyThere = false;
while (child) {
if (child.getAttribute("label") == prefillList[i+2]) {
alreadyThere = true;
break;
}
child = child.nextSibling;
}
if (!alreadyThere) {
menuPopup.appendChild(menuItem);
}
if(count == 0) {
var menuList = document.createElement("menulist");