Fix crash when dragging items to collections from advanced search window

(Dragging to the items list is still disabled.)
This commit is contained in:
Dan Stillman 2014-10-10 16:01:09 -04:00
parent e34c0db060
commit 9c9b8b835d
2 changed files with 9 additions and 1 deletions

View file

@ -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);
}

View file

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