mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-12-17 00:31:40 +00:00
thinking about crops linked in chains...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
b2d39f9615
commit
9360ed2332
26
ui/data4.js
26
ui/data4.js
@ -1211,6 +1211,8 @@ var DataPrototype = {
|
|||||||
// NOTE: this will not affect the original data object...
|
// NOTE: this will not affect the original data object...
|
||||||
// NOTE: this may result in empty ribbons...
|
// NOTE: this may result in empty ribbons...
|
||||||
// NOTE: this will not crop the .order...
|
// NOTE: this will not crop the .order...
|
||||||
|
//
|
||||||
|
// XXX should this link to .root and .parent data???
|
||||||
crop: function(list){
|
crop: function(list){
|
||||||
var crop = this.clone()
|
var crop = this.clone()
|
||||||
list = crop.makeSparseImages(list)
|
list = crop.makeSparseImages(list)
|
||||||
@ -1219,6 +1221,11 @@ var DataPrototype = {
|
|||||||
return list[i] != null
|
return list[i] != null
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// XXX ???
|
||||||
|
//crop.parent = this
|
||||||
|
//crop.root = this.root == null ? this : this.root
|
||||||
|
|
||||||
return crop
|
return crop
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1286,10 +1293,11 @@ var DataPrototype = {
|
|||||||
// .mergeRibbonCrop(..) method.
|
// .mergeRibbonCrop(..) method.
|
||||||
//
|
//
|
||||||
// XXX should there be a way to set the base ribbon???
|
// XXX should there be a way to set the base ribbon???
|
||||||
|
// XXX should this link to .root and .parent data???
|
||||||
// XXX do these belong here???
|
// XXX do these belong here???
|
||||||
cropRibbons: function(mode){
|
cropRibbons: function(mode){
|
||||||
mode = mode == null ? 'current' : mode
|
mode = mode == null ? 'current' : mode
|
||||||
var res = new Data()
|
var crop = new Data()
|
||||||
|
|
||||||
// get image representations from each ribbon...
|
// get image representations from each ribbon...
|
||||||
var that = this
|
var that = this
|
||||||
@ -1298,14 +1306,18 @@ var DataPrototype = {
|
|||||||
? function(e){ return that.getImage(mode, e) }
|
? function(e){ return that.getImage(mode, e) }
|
||||||
: mode)
|
: mode)
|
||||||
|
|
||||||
var r = res.newRibbon()
|
var r = crop.newRibbon()
|
||||||
|
|
||||||
res.ribbons[r] = images
|
crop.ribbons[r] = images
|
||||||
res.order = images.slice()
|
crop.order = images.slice()
|
||||||
res.base = r
|
crop.base = r
|
||||||
res.current = images[0]
|
crop.current = images[0]
|
||||||
|
|
||||||
return res
|
// XXX ???
|
||||||
|
//crop.parent = this
|
||||||
|
//crop.root = this.root == null ? this : this.root
|
||||||
|
|
||||||
|
return crop
|
||||||
},
|
},
|
||||||
|
|
||||||
// Merge the sortable ribbon representation into data...
|
// Merge the sortable ribbon representation into data...
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user