added a .cropped prop (bool) to the viewer and a .crop-mode css class to indicate a crop...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-05 17:31:11 +03:00
parent 1ed63e5850
commit 435918e1b0
2 changed files with 17 additions and 1 deletions

View File

@ -721,6 +721,11 @@ module.CropActions = actions.Actions({
} }
}], }],
// true if current viewer is cropped...
get cropped(){
return this.crop_stack != null
},
// crop... // crop...
// //
crop: ['- Crop/Crop image list', crop: ['- Crop/Crop image list',

View File

@ -26,12 +26,14 @@ var base = require('features/base')
var reloadAfter = var reloadAfter =
module.reloadAfter = module.reloadAfter =
function(force){ function(force, callback){
return function(){ return function(){
return function(){ return function(){
// NOTE: this may seem like cheating, but .reload() should // NOTE: this may seem like cheating, but .reload() should
// be very efficient, reusing all of the items loaded... // be very efficient, reusing all of the items loaded...
this.reload(force) this.reload(force)
callback && callback.apply(this, arguments)
} }
} }
} }
@ -756,6 +758,15 @@ module.Viewer = core.ImageGridFeatures.Feature({
delete this.__viewer_resize delete this.__viewer_resize
} }
}], }],
['crop uncrop',
function(){
if(this.cropped){
this.ribbons.viewer.addClass('crop-mode')
} else {
this.ribbons.viewer.removeClass('crop-mode')
}
}],
], ],
}) })