Show My Publications in Advanced Search and disable Save Search button
Closes #703 (unless I'm forgetting something)
This commit is contained in:
parent
3100f10396
commit
1e6bb44e80
|
@ -138,7 +138,9 @@ var ZoteroAdvancedSearch = new function() {
|
|||
|
||||
this.onLibraryChange = function (libraryID) {
|
||||
_libraryID = libraryID;
|
||||
document.getElementById('zotero-search-save').disabled = !Zotero.Libraries.isEditable(libraryID);
|
||||
var library = Zotero.Libraries.get(libraryID);
|
||||
var isEditable = library.editable && library.libraryType != 'publications';
|
||||
document.getElementById('zotero-search-save').disabled = !isEditable;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -88,27 +88,22 @@
|
|||
var libraryID = this.searchRef.libraryID;
|
||||
var libraryIndex = 0;
|
||||
|
||||
// Add My Library
|
||||
var menuitem = document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', Zotero.getString('pane.collections.library'));
|
||||
menuitem.setAttribute('libraryID', Zotero.Libraries.userLibraryID);
|
||||
menupopup.appendChild(menuitem);
|
||||
|
||||
// Add groups
|
||||
var groups = Zotero.Groups.getAll();
|
||||
for (let i = 0; i < groups.length; i++) {
|
||||
let group = groups[i];
|
||||
var libraries = Zotero.Libraries.getAll();
|
||||
var selectedIndex = 0;
|
||||
var i = 0;
|
||||
for (let library of libraries) {
|
||||
let menuitem = document.createElement('menuitem');
|
||||
menuitem.setAttribute('label', group.name);
|
||||
menuitem.setAttribute('libraryID', group.libraryID);
|
||||
if (group.libraryID == libraryID) {
|
||||
libraryIndex = i + 1;
|
||||
}
|
||||
menuitem.setAttribute('label', library.name);
|
||||
menuitem.setAttribute('libraryID', library.libraryID);
|
||||
menupopup.appendChild(menuitem);
|
||||
if (library.libraryID == libraryID) {
|
||||
selectedIndex = i;
|
||||
}
|
||||
i++
|
||||
}
|
||||
|
||||
menulist.appendChild(menupopup);
|
||||
menulist.selectedIndex = libraryIndex;
|
||||
menulist.selectedIndex = selectedIndex;
|
||||
|
||||
if (this.searchRef.id) {
|
||||
this.id('libraryMenu').disabled = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user