cleanup and more refactoring...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-02-15 08:04:20 +03:00
parent bfd7f1ad70
commit dec295fd05
2 changed files with 15 additions and 8 deletions

View File

@ -921,6 +921,20 @@ module.Base = core.ImageGridFeatures.Feature({
], ],
function(_, target){ this.markChanged('images', [this.data.getImage(target)]) }], function(_, target){ this.markChanged('images', [this.data.getImage(target)]) }],
['prepareIndexForWrite',
function(res){
res.index.current = res.raw.data.current
// XXX .data
// XXX .images
}],
['prepareJSONForLoad',
function(res, json){
res.data.current = json.current || res.data.current
// XXX .data
// XXX .images
}],
], ],
}) })

View File

@ -795,10 +795,6 @@ module.buildIndex = function(index, base_path){
// buildup the data object... // buildup the data object...
// NOTE: this is mostly to attach stuff that is stored in separate files... // NOTE: this is mostly to attach stuff that is stored in separate files...
// .current...
d.current = index.current || d.current
// images... // images...
// XXX there seems to be a problem with updated images... // XXX there seems to be a problem with updated images...
// - in the test set not all rotated manually images are loaded rotated... // - in the test set not all rotated manually images are loaded rotated...
@ -892,10 +888,7 @@ function(json, changes){
: changes == null ? true : changes == null ? true
: changes : changes
// always save current... var res = {}
var res = {
current: json.data.current,
}
// data... // data...
if(changes === true || changes && changes.data){ if(changes === true || changes && changes.data){