diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js index c7a28a842..e8f27f0ca 100644 --- a/chrome/content/zotero/overlay.js +++ b/chrome/content/zotero/overlay.js @@ -470,7 +470,7 @@ var ZoteroPane = new function() { if (!Zotero.stateCheck()) { this.displayErrorMessage(true); - return; + return false; } var item = new Zotero.Item(typeID); @@ -1655,7 +1655,7 @@ var ZoteroPane = new function() function addItemFromPage() { if (!Zotero.stateCheck()) { this.displayErrorMessage(true); - return; + return false; } var progressWin = new Zotero.ProgressWindow(); diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 7e581b0a9..23c37508f 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -889,17 +889,17 @@ Zotero.ItemGroup.prototype.getChildItems = function() * This accounts for the collection, saved search, quicksearch, tags, etc. */ Zotero.ItemGroup.prototype.getSearchObject = function() { + var includeScopeChildren = false; + // Create/load the inner search var s = new Zotero.Search(); - if (this.isLibrary()) { - s.addCondition('noChildren', true); - } + if (this.isLibrary()) { } else if (this.isCollection()) { - s.addCondition('noChildren', true); s.addCondition('collectionID', 'is', this.ref.getID()); if (Zotero.Prefs.get('recursiveCollections')) { s.addCondition('recursive', 'true'); } + includeScopeChildren = true; } else if (this.isSearch()){ s.load(this.ref['id']); @@ -910,7 +910,7 @@ Zotero.ItemGroup.prototype.getSearchObject = function() { // Create the outer (filter) search var s2 = new Zotero.Search(); - s2.setScope(s); + s2.setScope(s, includeScopeChildren); if (this.searchText) { s2.addCondition('quicksearch', 'contains', this.searchText); diff --git a/chrome/content/zotero/xpcom/zotero.js b/chrome/content/zotero/xpcom/zotero.js index ae5410a1c..9810deadc 100644 --- a/chrome/content/zotero/xpcom/zotero.js +++ b/chrome/content/zotero/xpcom/zotero.js @@ -224,6 +224,9 @@ var Zotero = new function(){ } + /* + * Check if a DB transaction is open and, if so, disable Zotero + */ function stateCheck() { if (Zotero.DB.transactionInProgress()) { this.initialized = false;