From cf2318ec5a185858f9479e04beda595170569776 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Tue, 10 Jan 2017 23:53:04 -0500 Subject: [PATCH] Move feeds below groups --- .../zotero/xpcom/collectionTreeView.js | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index 947f09f4c7..a788b1abcd 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -194,8 +194,36 @@ Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function* }), added++ ); - + // TODO: Unify feed and group adding code + + // Add groups + var groups = Zotero.Groups.getAll(); + if (groups.length) { + this._addRowToArray( + newRows, + new Zotero.CollectionTreeRow('separator', false), + added++ + ); + this._addRowToArray( + newRows, + new Zotero.CollectionTreeRow('header', { + id: "group-libraries-header", + label: Zotero.getString('pane.collections.groupLibraries'), + libraryID: -1 + }, 0), + added++ + ); + for (let group of groups) { + this._addRowToArray( + newRows, + new Zotero.CollectionTreeRow('group', group), + added++ + ); + added += yield this._expandRow(newRows, added - 1); + } + } + // Add feeds if (this.hideSources.indexOf('feeds') == -1) { var feeds = Zotero.Feeds.getAll(); @@ -230,33 +258,6 @@ Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function* } } } - - // Add groups - var groups = Zotero.Groups.getAll(); - if (groups.length) { - this._addRowToArray( - newRows, - new Zotero.CollectionTreeRow('separator', false), - added++ - ); - this._addRowToArray( - newRows, - new Zotero.CollectionTreeRow('header', { - id: "group-libraries-header", - label: Zotero.getString('pane.collections.groupLibraries'), - libraryID: -1 - }, 0), - added++ - ); - for (let group of groups) { - this._addRowToArray( - newRows, - new Zotero.CollectionTreeRow('group', group), - added++ - ); - added += yield this._expandRow(newRows, added - 1); - } - } this.selection.selectEventsSuppressed = true; this.selection.clearSelection();