added browse mode to relevant mark/bookmark/collection actions...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-09-06 07:59:28 +03:00
parent 17546ea8d8
commit e61403a06b

View File

@ -883,6 +883,8 @@ var CollectionTagsActions = actions.Actions({
function(collection){ function(collection){
return this.collectTagged('selected', collection) }], return this.collectTagged('selected', collection) }],
uncollectMarked: ['Collections|Mark/Remove marked from collection', uncollectMarked: ['Collections|Mark/Remove marked from collection',
{browseMode: function(){
return (!this.collection || this.marked.length == 0) && 'disabled' }},
function(collection){ function(collection){
return this.uncollectTagged('selected', collection) }], return this.uncollectTagged('selected', collection) }],
@ -891,6 +893,8 @@ var CollectionTagsActions = actions.Actions({
function(collection){ function(collection){
return this.collectTagged('bookmark', collection) }], return this.collectTagged('bookmark', collection) }],
uncollectBookmarked: ['Collections|Bookmark/Remove bookmarked from collection', uncollectBookmarked: ['Collections|Bookmark/Remove bookmarked from collection',
{browseMode: function(){
return (!this.collection || this.bookmarked.length == 0) && 'disabled' }},
function(collection){ function(collection){
return this.uncollectTagged('bookmark', collection) }], return this.uncollectTagged('bookmark', collection) }],
}) })
@ -1442,6 +1446,8 @@ var UICollectionActions = actions.Actions({
// XXX should this be here??? // XXX should this be here???
addMarkedToCollection: ['Collections|Mark/Add marked to $collection...', addMarkedToCollection: ['Collections|Mark/Add marked to $collection...',
{browseMode: function(){
return this.marked.length == 0 && 'disabled' }},
widgets.uiDialog(function(gids){ widgets.uiDialog(function(gids){
return this.browseCollections(function(title){ return this.browseCollections(function(title){
this.collectMarked(gids || this.current, title) }) })], this.collectMarked(gids || this.current, title) }) })],