commit 7bc80d1f32f029fb2985420897b92a0de939a2c5
parent 174405defb57be4a9719e15e86d2aeda1d7ae392
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 25 Apr 2016 00:32:32 -0400
Don't allow citing from feeds in classic dialog
And allow feeds to be hidden from collectionTreeView with hideSources
Fixes #964
Diffstat:
2 files changed, 21 insertions(+), 19 deletions(-)
diff --git a/chrome/content/zotero/selectItemsDialog.js b/chrome/content/zotero/selectItemsDialog.js
@@ -45,7 +45,7 @@ function doLoad()
collectionsView = new Zotero.CollectionTreeView();
// Don't show Commons when citing
- collectionsView.hideSources = ['duplicates', 'trash', 'commons'];
+ collectionsView.hideSources = ['duplicates', 'trash', 'feeds'];
document.getElementById('zotero-collections-tree').view = collectionsView;
if(io.select) itemsView.selectItem(io.select);
diff --git a/chrome/content/zotero/xpcom/collectionTreeView.js b/chrome/content/zotero/xpcom/collectionTreeView.js
@@ -211,28 +211,30 @@ Zotero.CollectionTreeView.prototype.refresh = Zotero.Promise.coroutine(function*
// TODO: Unify feed and group adding code
// Add feeds
- var feeds = Zotero.Feeds.getAll();
- if (feeds.length) {
- this._addRowToArray(
- newRows,
- new Zotero.CollectionTreeRow('separator', false),
- added++
- );
- this._addRowToArray(
- newRows,
- new Zotero.CollectionTreeRow('header', {
- id: "feed-libraries-header",
- label: Zotero.getString('pane.collections.feedLibraries'),
- libraryID: -1
- }, 0),
- added++
- );
- for (let feed of feeds) {
+ if (this.hideSources.indexOf('feeds') == -1) {
+ var feeds = Zotero.Feeds.getAll();
+ if (feeds.length) {
+ this._addRowToArray(
+ newRows,
+ new Zotero.CollectionTreeRow('separator', false),
+ added++
+ );
this._addRowToArray(
newRows,
- new Zotero.CollectionTreeRow('feed', feed),
+ new Zotero.CollectionTreeRow('header', {
+ id: "feed-libraries-header",
+ label: Zotero.getString('pane.collections.feedLibraries'),
+ libraryID: -1
+ }, 0),
added++
);
+ for (let feed of feeds) {
+ this._addRowToArray(
+ newRows,
+ new Zotero.CollectionTreeRow('feed', feed),
+ added++
+ );
+ }
}
}