From d868f007e92b65189517bb6dc05a7a5d20713c94 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Sun, 19 Jul 2015 17:08:36 -0400 Subject: [PATCH] Don't select new groups in collections pane --- chrome/content/zotero/xpcom/collectionTreeView.js | 6 ++---- test/tests/collectionTreeViewTest.js | 6 ++++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js index c3050de893..a6af173a62 100644 --- a/chrome/content/zotero/xpcom/collectionTreeView.js +++ b/chrome/content/zotero/xpcom/collectionTreeView.js @@ -431,12 +431,10 @@ Zotero.CollectionTreeView.prototype.notify = Zotero.Promise.coroutine(function* } break; - + case 'group': yield this.reload(); - // Groups can only be created during sync - let libraryID = Zotero.Groups.getLibraryIDFromGroupID(id); - yield this.selectByID("L" + libraryID); + yield this.restoreSelection(currentTreeRow); break; } } diff --git a/test/tests/collectionTreeViewTest.js b/test/tests/collectionTreeViewTest.js index 8121bb8de9..3adc25bba7 100644 --- a/test/tests/collectionTreeViewTest.js +++ b/test/tests/collectionTreeViewTest.js @@ -235,6 +235,12 @@ describe("Zotero.CollectionTreeView", function() { } }) + it("shouldn't select a new group", function* () { + var group = yield createGroup(); + // Library should still be selected + assert.equal(cv.getSelectedLibraryID(), Zotero.Libraries.userLibraryID); + }) + it("should remove a group and all children", function* () { // Make sure Group Libraries separator and header exist already, // since otherwise they'll interfere with the count