From 04ebffbfa0cf6aae444786a09b09ef5184b89162 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Tue, 2 May 2017 15:04:59 +0300 Subject: [PATCH] some more refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/base.js | 2 ++ ui (gen4)/features/ui.js | 40 ++++++++++++++++++++++---------------- 2 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index 5475f3c9..39805719 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -993,8 +993,10 @@ core.ImageGridFeatures.Feature({ }) + //--------------------------------------------------------------------- // Edit... + var BaseEditActions = module.BaseEditActions = actions.Actions({ diff --git a/ui (gen4)/features/ui.js b/ui (gen4)/features/ui.js index a8ddd4a9..14d3ccfe 100755 --- a/ui (gen4)/features/ui.js +++ b/ui (gen4)/features/ui.js @@ -1041,28 +1041,12 @@ module.Viewer = core.ImageGridFeatures.Feature({ ['resizingDone', function(){ this.scale = this.scale }], //*/ - - [[ - 'shiftImageTo.pre', - 'shiftImageUp.pre', - 'shiftImageDown.pre', - ], - function(target){ - return updateImagePosition(this, target) }], - - - // manage the .crop-mode css class... - ['crop uncrop', - function(){ - this.ribbons.viewer[this.cropped ? - 'addClass' - : 'removeClass']('crop-mode') - }], ], }) //--------------------------------------------------------------------- +// Viewer edit actions... // XXX Q: should this be further split into groups and tags??? var ViewerEditActions = @@ -1175,11 +1159,33 @@ core.ImageGridFeatures.Feature({ depends: [ 'base-edit', + 'tags', + 'sort', + 'crop', + 'image-group', 'ui', ], actions: ViewerEditActions, + handlers: [ + [[ + 'shiftImageTo.pre', + 'shiftImageUp.pre', + 'shiftImageDown.pre', + ], + function(target){ + return updateImagePosition(this, target) }], + + + // manage the .crop-mode css class... + ['crop uncrop', + function(){ + this.ribbons.viewer[this.cropped ? + 'addClass' + : 'removeClass']('crop-mode') + }], + ], })