more tweaking + some cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-09-09 01:40:31 +03:00
parent 70aa79d80b
commit 754094e6b3
3 changed files with 29 additions and 11 deletions

View File

@ -1629,7 +1629,7 @@ module.CropActions = actions.Actions({
// XXX
}],
// XXX save a crop (catalog)...
// XXX save a crop (catalog)..
// XXX
// XXX not sure if we actually need this...
@ -1637,7 +1637,7 @@ module.CropActions = actions.Actions({
{browseMode: function(){
return this.data.ribbon_order.length <= 1 && 'disabled' }},
function(list){ this.data.length > 0 && this.crop(list, true) }],
cropRibbon: ['Crop/Crop $ribbon',
cropRibbon: ['Crop|Ribbon/Crop $ribbon',
function(ribbon, flatten){
if(this.data.length == 0){
return
@ -1649,7 +1649,7 @@ module.CropActions = actions.Actions({
ribbon = ribbon || 'current'
this.crop(this.data.getImages(ribbon), flatten)
}],
cropOutRibbon: ['Crop/Crop ribbon out',
cropOutRibbon: ['Crop|Ribbon/Crop ribbon out',
function(ribbon, flatten){
ribbon = ribbon || this.current_ribbon
ribbon = ribbon instanceof Array ? ribbon : [ribbon]
@ -1743,6 +1743,7 @@ module.CropActions = actions.Actions({
if(gid in data.ribbons){
delete data.ribbons[gid]
data.ribbon_order.splice(data.ribbon_order.indexOf(gid), 1)
focus = true
return false
}
@ -1767,7 +1768,22 @@ module.CropActions = actions.Actions({
&& this.focusImage(
data.getImage(this.direction == 'left' ? 'before' : 'after')
|| data.getImage(this.direction == 'left' ? 'after' : 'before'))
}]
}],
removeRibbonFromCrop:['Crop|Ribbon/Remove ribbon from crop',
core.doc`
NOTE: this is a shorthand for .removeFromCrop(..) but only supports
ribbon removal.`,
{browseMode: 'uncrop'},
function(gids){
var that = this
gids = gids || this.current_ribbon
gids = gids == 'current' ? this.current_ribbon : gids
gids = gids instanceof Array ?
gids.filter(function(gid){ return that.data.ribbons[gid] })
: [gids]
return this.removeFromCrop(gids)
}],
})

View File

@ -1275,13 +1275,14 @@ module.AutoCollections = core.ImageGridFeatures.Feature({
var UICollectionActions = actions.Actions({
config: {
// XXX should we add reasonable defaults here???
'default-collections': null,
// Global default collections...
//
// NOTE: delete or set to null for none...
//'default-collections': null,
},
editDefaultCollections: ['Interface/Edit default collections...',
widgets.makeUIDialog(function(action){
var defaults =
this.config['default-collections'] =
(this.config['default-collections'] || []).slice()
@ -1304,7 +1305,6 @@ var UICollectionActions = actions.Actions({
})
})],
// XXX handle default collections...
browseCollections: ['Collections/$Collec$tions...',
core.doc`Collection list...

View File

@ -1136,9 +1136,11 @@ var BrowseActionsActions = actions.Actions({
'99:$Edit',
'$Navigate',
'$Image',
'Image/-90:---',
'Image/-90:.*remove.*',
'Image/-70:---',
'Image/-70:.*remove.*',
'$Ribbon',
'Ribbon/-70:---',
'Ribbon/-70:.*remove.*',
'$Crop',
'Crop/80:Crop $marked images',
'Crop/80:Crop $bookmarked images',
@ -1183,7 +1185,7 @@ var BrowseActionsActions = actions.Actions({
'Crop/-82:$Uncrop',
'Collec$tions',
'Collections/-70:---',
'Collections/-90:.*remove.*',
'Collections/-70:.*remove.*',
'$Mark',
//'Mark/-99:.*remove.*',
'$Bookmark',