some refactoring and cleanup...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-07-23 16:58:31 +03:00
parent dd24e9f9c3
commit 58ca38619d
2 changed files with 34 additions and 13 deletions

View File

@ -1365,18 +1365,6 @@ module.ImageEditGroupActions = actions.Actions({
{journal: true}, {journal: true},
function(target){ this.groupTo(target, 'next') }], function(target){ this.groupTo(target, 'next') }],
// NOTE: this will only group loaded images...
// XXX should this be someplace in marks-depended feature???
groupMarked: ['Group|Mark/Group loaded marked images',
{journal: true,
// XXX should this depend on marks more directly???
browseMode: function(){
return (this.data.tags
&& this.data.tags.selected
&& this.data.tags.selected.length > 0)
|| 'disabled' }},
function(){
this.group(this.data.getImages(this.data.getTaggedByAny('selected'))) }],
}) })
var ImageEditGroup = var ImageEditGroup =
@ -1388,6 +1376,8 @@ module.ImageEditGroup = core.ImageGridFeatures.Feature({
'image-group', 'image-group',
'edit', 'edit',
], ],
suggested: [
],
actions: ImageEditGroupActions, actions: ImageEditGroupActions,

View File

@ -257,6 +257,7 @@ module.ImageMarks = core.ImageGridFeatures.Feature({
suggested: [ suggested: [
'image-marks-edit', 'image-marks-edit',
'ui-image-marks', 'ui-image-marks',
'image-marks-groups',
], ],
actions: ImageMarkActions, actions: ImageMarkActions,
@ -375,6 +376,35 @@ module.ImageEditMarks = core.ImageGridFeatures.Feature({
}) })
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var ImageMarkGroupActions = actions.Actions({
// NOTE: this will only group loaded images...
groupMarked: ['Group|Mark/-99:Group loaded marked images',
{journal: true,
browseMode: 'cropMarked'},
function(){
this.group(this.data.getImages(this.marked)) }],
})
var ImageMarkGroup =
module.ImageMarkGroup = core.ImageGridFeatures.Feature({
title: '',
doc: '',
tag: 'image-marks-groups',
depends: [
'image-marks-edit',
'image-group-edit',
],
suggested: [
],
actions: ImageMarkGroupActions,
})
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
var ImageMarksUI = var ImageMarksUI =
@ -476,7 +506,7 @@ var ImageBookmarkEditActions = actions.Actions({
// 'on' - toggle all on // 'on' - toggle all on
// 'off' - toggle all off // 'off' - toggle all off
// 'next' - toggle each image to next state // 'next' - toggle each image to next state
toggleBookmarkOnMarked: ['Bookmark|Mark/Toggle bookmark on maked images', toggleBookmarkOnMarked: ['Bookmark|Mark/-99:Toggle bookmark on maked images',
{browseMode: 'cropMarked'}, {browseMode: 'cropMarked'},
function(action){ function(action){
return this.toggleBookmark(this.data.getTaggedByAny('selected'), action) return this.toggleBookmark(this.data.getTaggedByAny('selected'), action)
@ -531,6 +561,7 @@ module.ImageBookmarksUI = core.ImageGridFeatures.Feature({
}) })
//--------------------------------------------------------------------- //---------------------------------------------------------------------
core.ImageGridFeatures.Feature('marks', [ core.ImageGridFeatures.Feature('marks', [