diff --git a/chrome/content/zotero/advancedSearch.js b/chrome/content/zotero/advancedSearch.js index 4bb5cefe7..896829686 100644 --- a/chrome/content/zotero/advancedSearch.js +++ b/chrome/content/zotero/advancedSearch.js @@ -35,6 +35,7 @@ var ZoteroAdvancedSearch = new function() { this.itemsView = false; var _searchBox; + var _libraryID; function onLoad() { _searchBox = document.getElementById('zotero-search-box'); @@ -53,8 +54,11 @@ var ZoteroAdvancedSearch = new function() { _searchBox.updateSearch(); _searchBox.active = true; - // A minimal implementation of Zotero.CollectionTreeView + // A minimal implementation of Zotero.ItemGroup var itemGroup = { + ref: { + libraryID: _libraryID + }, isSearchMode: function() { return true; }, getItems: function () { var search = _searchBox.search.clone(); @@ -147,6 +151,7 @@ var ZoteroAdvancedSearch = new function() { this.onLibraryChange = function (libraryID) { + _libraryID = libraryID; document.getElementById('zotero-search-save').disabled = !Zotero.Libraries.isEditable(libraryID); } diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index f1c38d93e..9303b3282 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -2672,6 +2672,9 @@ Zotero.DragDrop = { return false; } var win = sourceNode.ownerDocument.defaultView; + if (win.document.documentElement.getAttribute('windowtype') == 'zotero:search') { + return win.ZoteroAdvancedSearch.itemsView.itemGroup; + } return win.ZoteroPane.collectionsView.itemGroup; } else {