diff --git a/browser/src/control/Control.Zotero.js b/browser/src/control/Control.Zotero.js index 84b8503d1..5ef911a14 100644 --- a/browser/src/control/Control.Zotero.js +++ b/browser/src/control/Control.Zotero.js @@ -1064,7 +1064,7 @@ L.Control.Zotero = L.Control.extend({ var targetEntry = this._findEntryWithUrl(searchArray, row); if (entry && targetEntry) { - if (targetEntry.children.length === 1 + if (targetEntry.children && targetEntry.children.length === 1 && targetEntry.children[0].text === '') { targetEntry.children = []; targetEntry.ondemand = undefined; @@ -1133,7 +1133,8 @@ L.Control.Zotero = L.Control.extend({ } } if (element === 'edit' && data.id === 'zoterosearch') { - document.getElementById('zoterolist').filterEntries(data.value); + if (data.value) + document.getElementById('zoterolist').filterEntries(data.value); return; } if (data.id == 'ok') { diff --git a/browser/src/control/jsdialog/Widget.Combobox.js b/browser/src/control/jsdialog/Widget.Combobox.js index 2ad1b0921..3a9b8a6d8 100644 --- a/browser/src/control/jsdialog/Widget.Combobox.js +++ b/browser/src/control/jsdialog/Widget.Combobox.js @@ -279,7 +279,7 @@ JSDialog.combobox = function (parentContainer, data, builder) { var callback = function(objectType, eventType, object, data) { // send command with correct WindowId (from parent, not dropdown) if (eventType !== 'close') - parentBuilder._defaultCallbackHandler(objectType, eventType, object, data, parentBuilder); + parentBuilder.callback(objectType, eventType, object, data, parentBuilder); // close after selection if (eventType === 'selected') {