From 8ec1217dec6fd2aa09f00d13eb6bf798013e366c Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 5 May 2016 18:19:24 +0300 Subject: [PATCH] now .savecomments should be saved to fs (needs more testing)... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index be943aa6..34a1fcb6 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -481,6 +481,8 @@ var FileSystemLoaderUIActions = actions.Actions({ // { // : // } + // + // XXX need to save/restore these... savecomments: null, @@ -719,6 +721,26 @@ var FileSystemLoaderUIActions = actions.Actions({ return o })], + + + // save/resore .savecomments + // + // NOTE: we are doing preparation for saving .savecomments to fs + // below in FileSystemLoaderUI.handlers. + // This is because defining the action here would make it run + // before the base action (which is defined later). + json: [function(){ + return function(res){ + if(this.savecomments != null){ + res.savecomments = this.savecomments + } + } + }], + load: [function(data){ + if(data.savecomments != null){ + this.savecomments = data.savecomments + } + }] }) @@ -735,6 +757,16 @@ module.FileSystemLoaderUI = core.ImageGridFeatures.Feature({ ], actions: FileSystemLoaderUIActions, + + handlers: [ + ['prepareIndexForWrite', + function(res){ + var source = res.raw.savecomments + if(source && Object.keys(source).length > 0){ + res.prepared.savecomments = source + } + }] + ] })