www

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

commit 238183a3fa14bda0de8249a23460754f5f908465
parent 41b772da4d14a4572f3f8146927104d221d2b963
Author: Dan Stillman <dstillman@zotero.org>
Date:   Mon,  6 Jul 2015 04:38:13 -0400

Fix collapse library ("-") for collections

Broken in f5ce2d238e

Diffstat:
Mchrome/content/zotero/xpcom/collectionTreeView.js | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -653,7 +653,12 @@ Zotero.CollectionTreeView.prototype.collapseLibrary = function(self) { var found = false; for (var i=self.rowCount-1; i>=0; i--) { - if (self._getItemAtRow(i).ref.libraryID !== selectedLibraryID) { + let rowLibraryID = self._getItemAtRow(i).ref.libraryID; + // TEMP: Remove in 5.0 when we can just compare libraryIDs without worrying about null + if (rowLibraryID === 0) { + rowLibraryID = null; + } + if (rowLibraryID !== selectedLibraryID) { // Once we've moved beyond the original library, stop looking if (found) { break; @@ -1013,9 +1018,7 @@ Zotero.CollectionTreeView.prototype._expandRow = function (row, forceOpen) { // Unfiled items if (showUnfiled) { var s = new Zotero.Search; - if (isGroup) { - s.libraryID = libraryID; - } + s.libraryID = intLibraryID; s.name = Zotero.getString('pane.collections.unfiled'); s.addCondition('libraryID', 'is', libraryID); s.addCondition('unfiled', 'true');