From 045f1fbb7e86eb6ee1e9790892687a18ab8f868a Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Fri, 8 Dec 2017 00:01:24 -0500 Subject: [PATCH] Add utility functions for building drop-down library lists A XUL one for the current use in Advanced Search and an HTML one for future uses. Sets the value to libraryID and adds data attributes for editable/filesEditable on the HTML one. --- .../content/zotero/bindings/zoterosearch.xml | 50 ++++--------------- .../zotero/xpcom/utilities_internal.js | 47 ++++++++++++++++- test/tests/advancedSearchTest.js | 2 +- 3 files changed, 58 insertions(+), 41 deletions(-) diff --git a/chrome/content/zotero/bindings/zoterosearch.xml b/chrome/content/zotero/bindings/zoterosearch.xml index 092d914194..eb4b935574 100644 --- a/chrome/content/zotero/bindings/zoterosearch.xml +++ b/chrome/content/zotero/bindings/zoterosearch.xml @@ -49,7 +49,16 @@ - - - - @@ -170,7 +142,7 @@ element. * If has no children, returns a element, otherwise . diff --git a/test/tests/advancedSearchTest.js b/test/tests/advancedSearchTest.js index 3f2f905a5b..5a0182e97a 100644 --- a/test/tests/advancedSearchTest.js +++ b/test/tests/advancedSearchTest.js @@ -202,7 +202,7 @@ describe("Advanced Search", function () { for (let i = 0; i < libraryMenu.itemCount; i++) { let menuitem = libraryMenu.getItemAtIndex(i); // Switch to group library - if (menuitem.getAttribute('libraryID') == groupLibraryID) { + if (menuitem.value == groupLibraryID) { menuitem.click(); break; }