mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-30 19:00:09 +00:00
removed order saving from data -- make this a seporate plugin/module...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
12dcb83353
commit
eda7e1ef60
@ -152,19 +152,6 @@ module.DataPrototype = {
|
|||||||
// NOTE: this list may contain gids not loaded at the moment,
|
// NOTE: this list may contain gids not loaded at the moment,
|
||||||
// a common case for this is when data is cropped.
|
// a common case for this is when data is cropped.
|
||||||
//
|
//
|
||||||
// .order_list EXPERIMENTAL
|
|
||||||
// Dict of named user defined order lists
|
|
||||||
//
|
|
||||||
// format:
|
|
||||||
// { name: [ gid, .. ], .. }
|
|
||||||
//
|
|
||||||
// reserved order names:
|
|
||||||
// 'last' - stores the last order before cange
|
|
||||||
// 'manual' - stores the last user-defined orderbefore
|
|
||||||
// resort
|
|
||||||
//
|
|
||||||
// NOTE: this attr is optional...
|
|
||||||
//
|
|
||||||
// .ribbon_order
|
// .ribbon_order
|
||||||
// List of ribbon gids setting the ribbon order.
|
// List of ribbon gids setting the ribbon order.
|
||||||
//
|
//
|
||||||
@ -839,23 +826,6 @@ module.DataPrototype = {
|
|||||||
return this
|
return this
|
||||||
},
|
},
|
||||||
|
|
||||||
// XXX should these be here or in a pligin???
|
|
||||||
saveOrderAs: function(name, order){
|
|
||||||
if(this.order_list == null){
|
|
||||||
this.order_list = {}
|
|
||||||
}
|
|
||||||
this.order_list[name] = order != null ? order : this.order.slice()
|
|
||||||
return this
|
|
||||||
},
|
|
||||||
loadOrder: function(name){
|
|
||||||
var order = name.constructor.name == 'Array' ? name : this.order_list[name].slice()
|
|
||||||
if(order == null){
|
|
||||||
return this
|
|
||||||
}
|
|
||||||
this.order = order
|
|
||||||
return this.sortImages()
|
|
||||||
},
|
|
||||||
|
|
||||||
// Shift image...
|
// Shift image...
|
||||||
//
|
//
|
||||||
// Shift image to target position:
|
// Shift image to target position:
|
||||||
@ -1442,7 +1412,6 @@ module.DataPrototype = {
|
|||||||
this.base = data.base
|
this.base = data.base
|
||||||
this.current = data.current
|
this.current = data.current
|
||||||
this.order = data.order.slice()
|
this.order = data.order.slice()
|
||||||
this.order_list = data.order_list != null ? JSON.parse(JSON.stringify(data.order_list)) : null
|
|
||||||
this.ribbon_order = data.ribbon_order.slice()
|
this.ribbon_order = data.ribbon_order.slice()
|
||||||
this.ribbons = {}
|
this.ribbons = {}
|
||||||
// make ribbons sparse...
|
// make ribbons sparse...
|
||||||
@ -1465,10 +1434,6 @@ module.DataPrototype = {
|
|||||||
ribbon_order: this.ribbon_order.slice(),
|
ribbon_order: this.ribbon_order.slice(),
|
||||||
ribbons: {},
|
ribbons: {},
|
||||||
}
|
}
|
||||||
if(this.order_list != null && Object.keys(this.order_list).length > 0){
|
|
||||||
// do a deep copy...
|
|
||||||
res.order_list = JSON.parse(JSON.stringify(this.order_list))
|
|
||||||
}
|
|
||||||
// compact ribbons...
|
// compact ribbons...
|
||||||
for(var k in this.ribbons){
|
for(var k in this.ribbons){
|
||||||
res.ribbons[k] = this.ribbons[k].compact()
|
res.ribbons[k] = this.ribbons[k].compact()
|
||||||
|
|||||||
@ -106,6 +106,7 @@ function(data){
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* This is best kept as a separate entity...
|
||||||
// XXX EXPERIMENTAL...
|
// XXX EXPERIMENTAL...
|
||||||
module.VERSIONS['3.1'] =
|
module.VERSIONS['3.1'] =
|
||||||
function(data){
|
function(data){
|
||||||
@ -116,6 +117,7 @@ function(data){
|
|||||||
|
|
||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user