mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +00:00
minor refactoring...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
ba32b2cce2
commit
fbc8e686a2
@ -1017,6 +1017,7 @@ module.Collection = core.ImageGridFeatures.Feature({
|
|||||||
// transfer changes on load/unload collection...
|
// transfer changes on load/unload collection...
|
||||||
// XXX also need to account for changes when doing .prepareIndexForWrite(..)
|
// XXX also need to account for changes when doing .prepareIndexForWrite(..)
|
||||||
// in 'base' mode...
|
// in 'base' mode...
|
||||||
|
// XXX use the event .collectionLoading(..) instead of .loadCollection(..) action???
|
||||||
//['collectionLoading.pre',
|
//['collectionLoading.pre',
|
||||||
['loadCollection.pre',
|
['loadCollection.pre',
|
||||||
function(collection){
|
function(collection){
|
||||||
|
|||||||
@ -22,7 +22,7 @@ function(data){
|
|||||||
var ribbons = data.ribbons = data.ribbons || {}
|
var ribbons = data.ribbons = data.ribbons || {}
|
||||||
|
|
||||||
if(Object.keys(ribbons).length == 0){
|
if(Object.keys(ribbons).length == 0){
|
||||||
ribbons[that.newGid()] = data.order.slice()
|
ribbons[that.newGID()] = data.order.slice()
|
||||||
}
|
}
|
||||||
|
|
||||||
data.ribbon_order = data.ribbon_order || Object.keys(ribbons)
|
data.ribbon_order = data.ribbon_order || Object.keys(ribbons)
|
||||||
@ -90,7 +90,7 @@ function(data, cmp){
|
|||||||
//
|
//
|
||||||
// NOTE: this will just convert the JSON format and will not construct
|
// NOTE: this will just convert the JSON format and will not construct
|
||||||
// the Data object...
|
// the Data object...
|
||||||
// NOTE: this uses require('imagegrid/data').Data().newGid(..) for ribbon gid
|
// NOTE: this uses require('imagegrid/data').Data().newGID(..) for ribbon gid
|
||||||
// generation...
|
// generation...
|
||||||
//
|
//
|
||||||
module.VERSIONS['3.0'] =
|
module.VERSIONS['3.0'] =
|
||||||
@ -116,7 +116,7 @@ function(data){
|
|||||||
? data.ribbon_order
|
? data.ribbon_order
|
||||||
: Object.keys(data.ribbons)
|
: Object.keys(data.ribbons)
|
||||||
keys.forEach(function(k){
|
keys.forEach(function(k){
|
||||||
var gid = k*1 == null ? k : that.newGid()
|
var gid = k*1 == null ? k : that.newGID()
|
||||||
res.ribbon_order.push(gid)
|
res.ribbon_order.push(gid)
|
||||||
res.ribbons[gid] = data.ribbons[k].slice()
|
res.ribbons[gid] = data.ribbons[k].slice()
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user