some refactoring and tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-12-09 22:01:32 +03:00
parent d48f1b5511
commit cac15fb4ba

View File

@ -2141,7 +2141,7 @@ var UICollectionActions = actions.Actions({
new_item: new_message ?
new_message
: action ?
'$New..'
'$New...'
: '$New from current state...',
unique: true,
@ -2213,7 +2213,9 @@ var UICollectionActions = actions.Actions({
}, {
cls: 'collection-list',
// focus current collection...
selected: JSON.stringify(
selected: (action && that.config['collection-last-used']) ?
that.config['collection-last-used']
: JSON.stringify(
(that.collection || MAIN_COLLECTION_TITLE)
// XXX not sure it is good that we have to do this...
.replace(/\$/g, '')),
@ -2222,6 +2224,9 @@ var UICollectionActions = actions.Actions({
.run(function(){
this.keyboard
.handler('General', 'F2', 'Menu') })
.open(function(_, title){
action
&& (that.config['collection-last-used'] = title) })
.close(function(){
that.collection_order = collections
@ -2310,31 +2315,15 @@ var UICollectionActions = actions.Actions({
}) })],
addToCollection: ['Collections|Image/Add $image to collection...',
widgets.uiDialog(function(gids){
var that = this
return this.browseCollections(function(title){
this.collect(gids || 'current', title) })
.run(function(){
var title = that.config['collection-last-used']
title
&& this.select(`"${title}"`) })
.open(function(_, title){
that.config['collection-last-used'] = title })
})],
this.collect(gids || 'current', title) }) })],
addRibbonToCollection: ['Collections|Ribbon/Add $ribbon to collection...',
widgets.uiDialog(function(){ return this.addToCollection('ribbon') })],
addLoadedToCollection: ['Collections/$Add loaded images to collection...',
widgets.uiDialog(function(){ return this.addToCollection('loaded') })],
joinToCollection: ['Collections/$Merge view to collection...',
widgets.uiDialog(function(){
var that = this
return this.browseCollections(function(title){ this.joinCollect(title) })
.run(function(){
var title = that.config['collection-last-used']
title
&& this.select(`"${title}"`) })
.open(function(_, title){
that.config['collection-last-used'] = title })
})],
return this.browseCollections(function(title){ this.joinCollect(title) }) })],
// XXX should this be here or in marks???
addMarkedToCollection: ['Collections|Mark/Add marked to $collection...',