www

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

commit 9212fbacf3c4590437f846b6ac76a0454790b9e6
parent a5eba7fb385ae7b26fa5194d43a7168ba1081889
Author: Fred Gibbs <fwgibbs@gmail.com>
Date:   Mon, 29 Mar 2010 03:49:28 +0000

enable refresh and remove Commons buckets

Diffstat:
Mchrome/content/zotero/overlay.js | 26++++++++++++++++++++------
1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/chrome/content/zotero/overlay.js b/chrome/content/zotero/overlay.js @@ -1462,7 +1462,7 @@ var ZoteroPane = new function() } } - this.createBucket = function() { + this.createCommonsBucket = function() { var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"] .getService(Components.interfaces.nsIPromptService); @@ -1477,7 +1477,20 @@ var ZoteroPane = new function() } } - this.removeBucket = function() { + this.refreshCommonsBucket = function() { + if (this.collectionsView + && this.collectionsView.selection + && this.collectionsView.selection.count > 0 + && this.collectionsView.selection.currentIndex != -1) { + var bucket = this.collectionsView._getItemAtRow(this.collectionsView.selection.currentIndex); + if (bucket && bucket.isBucket()) { + this.itemsView._itemGroup.ref._items = null; + this.itemsView.refresh(); + } + } + } + + this.removeCommonsBucket = function() { if (this.collectionsView && this.collectionsView.selection && this.collectionsView.selection.count > 0 @@ -1789,9 +1802,10 @@ var ZoteroPane = new function() exportFile: 9, loadReport: 10, emptyTrash: 11, - createBucket: 12, + createCommonsBucket: 12, syncBucketList: 13, - removeBucket: 14 + removeCommonsBucket: 14, + refreshCommonsBucket: 15 }; var itemGroup = this.collectionsView._getItemAtRow(this.collectionsView.selection.currentIndex); @@ -1862,11 +1876,11 @@ var ZoteroPane = new function() // Header else if (itemGroup.isHeader()) { if (itemGroup.ref.id == 'commons-header') { - show = [m.createBucket, m.syncBucketList]; + show = [m.createCommonsBucket, m.syncBucketList]; } } else if (itemGroup.isBucket()) { - show = [m.removeBucket]; + show = [m.removeCommonsBucket, m.refreshCommonsBucket]; } // Group else if (itemGroup.isGroup()) {