some more refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-05-02 15:04:59 +03:00
parent 9ce4e3c0c4
commit 04ebffbfa0
2 changed files with 25 additions and 17 deletions

View File

@ -993,8 +993,10 @@ core.ImageGridFeatures.Feature({
}) })
//--------------------------------------------------------------------- //---------------------------------------------------------------------
// Edit... // Edit...
var BaseEditActions = var BaseEditActions =
module.BaseEditActions = module.BaseEditActions =
actions.Actions({ actions.Actions({

View File

@ -1041,28 +1041,12 @@ module.Viewer = core.ImageGridFeatures.Feature({
['resizingDone', ['resizingDone',
function(){ this.scale = this.scale }], 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??? // XXX Q: should this be further split into groups and tags???
var ViewerEditActions = var ViewerEditActions =
@ -1175,11 +1159,33 @@ core.ImageGridFeatures.Feature({
depends: [ depends: [
'base-edit', 'base-edit',
'tags',
'sort',
'crop',
'image-group',
'ui', 'ui',
], ],
actions: ViewerEditActions, 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')
}],
],
}) })