mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-11-01 11:50:07 +00:00
added .uncropAndKeepOrder(..) action...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d955933454
commit
c6044ce31d
@ -365,10 +365,11 @@ actions.Actions({
|
|||||||
this.data = this.data.crop(list, flatten)
|
this.data = this.data.crop(list, flatten)
|
||||||
}],
|
}],
|
||||||
uncrop: ['Uncrop ribbons',
|
uncrop: ['Uncrop ribbons',
|
||||||
function(level, restore_current){
|
function(level, restore_current, keep_crop_order){
|
||||||
level = level || 1
|
level = level || 1
|
||||||
|
|
||||||
var cur = this.current
|
var cur = this.current
|
||||||
|
var order = this.data.order
|
||||||
|
|
||||||
if(this.crop_stack == null){
|
if(this.crop_stack == null){
|
||||||
return
|
return
|
||||||
@ -389,16 +390,21 @@ actions.Actions({
|
|||||||
this.data.focusImage(cur)
|
this.data.focusImage(cur)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore order from the crop...
|
||||||
|
if(keep_crop_order){
|
||||||
|
this.data.order = order
|
||||||
|
this.data.sortImages()
|
||||||
|
}
|
||||||
|
|
||||||
|
// purge the stack...
|
||||||
if(this.crop_stack.length == 0){
|
if(this.crop_stack.length == 0){
|
||||||
delete this.crop_stack
|
delete this.crop_stack
|
||||||
}
|
}
|
||||||
}],
|
}],
|
||||||
uncropAll: ['',
|
uncropAll: ['',
|
||||||
function(restore_current){ this.uncrop('all', restore_current) }],
|
function(restore_current){ this.uncrop('all', restore_current) }],
|
||||||
// XXX not sure about this...
|
uncropAndKeepOrder: ['Uncrop and keep crop image order',
|
||||||
uncropAndKeepOrder: ['',
|
function(level, restore_current){ this.uncrop(level, restore_current, true) }],
|
||||||
function(){
|
|
||||||
}],
|
|
||||||
// XXX same as uncrop but will also try and merge changes...
|
// XXX same as uncrop but will also try and merge changes...
|
||||||
mergeCrop: ['',
|
mergeCrop: ['',
|
||||||
function(){
|
function(){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user