mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
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:
parent
1ed63e5850
commit
435918e1b0
@ -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',
|
||||||
|
|||||||
@ -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')
|
||||||
|
}
|
||||||
|
}],
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user