From dec295fd05108ba1f83339bb2dbbd1e79c7bcd1e Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Wed, 15 Feb 2017 08:04:20 +0300 Subject: [PATCH] cleanup and more refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/base.js | 14 ++++++++++++++ ui (gen4)/imagegrid/file.js | 9 +-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index 4b4dee98..b04402ff 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -921,6 +921,20 @@ module.Base = core.ImageGridFeatures.Feature({ ], 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 + }], ], }) diff --git a/ui (gen4)/imagegrid/file.js b/ui (gen4)/imagegrid/file.js index fa258915..39d5afa0 100755 --- a/ui (gen4)/imagegrid/file.js +++ b/ui (gen4)/imagegrid/file.js @@ -795,10 +795,6 @@ module.buildIndex = function(index, base_path){ // buildup the data object... // NOTE: this is mostly to attach stuff that is stored in separate files... - // .current... - d.current = index.current || d.current - - // images... // XXX there seems to be a problem with updated images... // - in the test set not all rotated manually images are loaded rotated... @@ -892,10 +888,7 @@ function(json, changes){ : changes == null ? true : changes - // always save current... - var res = { - current: json.data.current, - } + var res = {} // data... if(changes === true || changes && changes.data){