minor refactoring + moved crop context keys to the crop context...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2016-04-05 18:54:09 +03:00
parent 435918e1b0
commit 6de70e7b98
2 changed files with 11 additions and 12 deletions

View File

@ -64,12 +64,17 @@ module.GLOBAL_KEYBOARD = {
Esc: 'toggleSingleImage: "off" -- Exit single image view',
},
// XXX cropped -- needs a class to indicate a crop...
// XXX add "save as collection..."
'Cropped': {
// XXX make .crop(..) toggle the class...
pattern: '.crop-mode',
Esc: {
default: 'uncrop',
ctrl: 'uncropAll',
},
},
// XXX add "save as collection..." (???)
// XXX cleanup...
'Viewer': {
doc: 'NOTE: binding priority is the same as the order of sections '+
@ -203,10 +208,6 @@ module.GLOBAL_KEYBOARD = {
ctrl: 'cropMarked',
alt: 'cropBookmarked',
},
Esc: {
default: 'uncrop',
ctrl: 'uncropAll',
},
// marking...
M: {

View File

@ -758,14 +758,12 @@ module.Viewer = core.ImageGridFeatures.Feature({
delete this.__viewer_resize
}
}],
// manage the .crop-mode css class...
['crop uncrop',
function(){
if(this.cropped){
this.ribbons.viewer.addClass('crop-mode')
} else {
this.ribbons.viewer.removeClass('crop-mode')
}
this.ribbons.viewer[this.cropped ?
'addClass'
: 'removeClass']('crop-mode')
}],
],
})