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...
var BaseEditActions =
module.BaseEditActions =
actions.Actions({

View File

@ -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')
}],
],
})