fx-compat: Fix New Item menu and serializePersist()

`document.getElementsByAttribute` → `document.querySelectorAll`
This commit is contained in:
Dan Stillman 2022-05-04 06:40:38 -04:00
parent 9222b939ab
commit 13b9837524

View file

@ -278,10 +278,10 @@ var ZoteroPane = new function()
return;
}
var addMenu = document.getElementById('zotero-tb-add').firstChild;
var addMenu = document.getElementById('zotero-tb-add').firstElementChild;
// Remove all nodes so we can regenerate
var options = addMenu.getElementsByAttribute("class", "zotero-tb-add");
var options = addMenu.querySelectorAll('.zotero-tb-add');
while (options.length) {
var p = options[0].parentNode;
p.removeChild(options[0]);
@ -5377,7 +5377,7 @@ var ZoteroPane = new function()
catch (e) {
serializedValues = {};
}
for (let el of document.getElementsByAttribute("zotero-persist", "*")) {
for (let el of document.querySelectorAll("[zotero-persist]")) {
if (!el.getAttribute) continue;
var id = el.getAttribute("id");
if (!id) continue;