From 58ca38619d40b92e9ecc8f637c2b2819f02a9573 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sun, 23 Jul 2017 16:58:31 +0300 Subject: [PATCH] some refactoring and cleanup... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/base.js | 14 ++------------ ui (gen4)/features/marks.js | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index da0ee49c..4ed981f9 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -1365,18 +1365,6 @@ module.ImageEditGroupActions = actions.Actions({ {journal: true}, 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 = @@ -1388,6 +1376,8 @@ module.ImageEditGroup = core.ImageGridFeatures.Feature({ 'image-group', 'edit', ], + suggested: [ + ], actions: ImageEditGroupActions, diff --git a/ui (gen4)/features/marks.js b/ui (gen4)/features/marks.js index 766582a9..55353606 100755 --- a/ui (gen4)/features/marks.js +++ b/ui (gen4)/features/marks.js @@ -257,6 +257,7 @@ module.ImageMarks = core.ImageGridFeatures.Feature({ suggested: [ 'image-marks-edit', 'ui-image-marks', + 'image-marks-groups', ], 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 = @@ -476,7 +506,7 @@ var ImageBookmarkEditActions = actions.Actions({ // 'on' - toggle all on // 'off' - toggle all off // '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'}, function(action){ return this.toggleBookmark(this.data.getTaggedByAny('selected'), action) @@ -531,6 +561,7 @@ module.ImageBookmarksUI = core.ImageGridFeatures.Feature({ }) + //--------------------------------------------------------------------- core.ImageGridFeatures.Feature('marks', [