diff --git a/ui (gen4)/features/base.js b/ui (gen4)/features/base.js index 07e4c9bc..c5377dbb 100755 --- a/ui (gen4)/features/base.js +++ b/ui (gen4)/features/base.js @@ -979,16 +979,6 @@ module.Base = core.ImageGridFeatures.Feature({ img.forEach(function(_, img){ img.base_path = base_path }) } - // extra stuff... - // ...this will restore stuff stored in the data but not - // explicitly restored above... - // XXX do we need this??? - Object.keys(json.data).forEach(function(k){ - if(d[k] === undefined){ - d[k] = json.data[k] - } - }) - res.data = d res.images = img }], diff --git a/ui (gen4)/imagegrid/data.js b/ui (gen4)/imagegrid/data.js index 73d10861..3b3440c6 100755 --- a/ui (gen4)/imagegrid/data.js +++ b/ui (gen4)/imagegrid/data.js @@ -2529,7 +2529,7 @@ var DataPrototype = { // // NOTE: this loads in-place, use .fromJSON(..) to create new data... // XXX should this process defaults for unset values??? - loadJSON: function(data){ + loadJSON: function(data, clean){ var that = this data = typeof(data) == typeof('str') ? JSON.parse(data) : data data = formats.updateData(data) @@ -2550,6 +2550,15 @@ var DataPrototype = { that[s][k] = that.makeSparseImages(data[s][k]) } }) + + // extra data... + !clean + && Object.keys(data).forEach(function(k){ + if(k != 'version' && that[k] === undefined){ + that[k] = data[k] + } + }) + return this }, @@ -2559,7 +2568,7 @@ var DataPrototype = { // the result... dumpJSON: function(mode){ var res = { - varsion: module.DATA_VERSION, + version: module.DATA_VERSION, base: this.base, current: this.current, order: this.order.slice(), diff --git a/ui (gen4)/imagegrid/formats.js b/ui (gen4)/imagegrid/formats.js index b121db1a..2e0f50e9 100755 --- a/ui (gen4)/imagegrid/formats.js +++ b/ui (gen4)/imagegrid/formats.js @@ -101,6 +101,7 @@ function(data){ // we set the base to the first ribbon... res.base = data.base == null ? res.ribbon_order[0] : res.base + return res } @@ -147,7 +148,7 @@ module.updateData = function(data, clean){ !clean && Object.keys(data).forEach(function(k){ - if(res[k] == null){ + if(res[k] === undefined){ res[k] = data[k] } })