зеркало из https://github.com/mozilla/pjs.git
bug 94590, remove dup entries from wallet preview dialog, r=law, sr=alecf
This commit is contained in:
Родитель
dc7857f028
Коммит
8ce7697fae
|
@ -56,7 +56,20 @@ function Startup() {
|
||||||
menuItem.setAttribute("selected", "true");
|
menuItem.setAttribute("selected", "true");
|
||||||
}
|
}
|
||||||
menuItem.setAttribute("label", prefillList[i+2]);
|
menuItem.setAttribute("label", prefillList[i+2]);
|
||||||
|
|
||||||
|
/* 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);
|
menuPopup.appendChild(menuItem);
|
||||||
|
}
|
||||||
|
|
||||||
if(count == 0) {
|
if(count == 0) {
|
||||||
var menuList = document.createElement("menulist");
|
var menuList = document.createElement("menulist");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче