www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | Submodules | README | LICENSE

commit 9c9b8b835d5a81b3c94f466d3cc47a602522d817
parent e34c0db060ecd79117ffe5bd218a3250c5fe5bb5
Author: Dan Stillman <dstillman@zotero.org>
Date:   Fri, 10 Oct 2014 16:01:09 -0400

Fix crash when dragging items to collections from advanced search window

(Dragging to the items list is still disabled.)

Diffstat:
Mchrome/content/zotero/advancedSearch.js | 7++++++-
Mchrome/content/zotero/xpcom/zotero.js | 3+++
2 files changed, 9 insertions(+), 1 deletion(-)

diff --git 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 @@ -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 {