From 18d57b2d27c67a05ea88d14cd99f2c52da4a1edc Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Thu, 5 May 2016 18:29:40 +0300 Subject: [PATCH] cleanup and minor refactoring... Signed-off-by: Alex A. Naanou --- ui (gen4)/features/filesystem.js | 37 +++++++++++++++----------------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/ui (gen4)/features/filesystem.js b/ui (gen4)/features/filesystem.js index 34a1fcb6..60ea5c1b 100755 --- a/ui (gen4)/features/filesystem.js +++ b/ui (gen4)/features/filesystem.js @@ -721,26 +721,6 @@ 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 - } - }] }) @@ -759,6 +739,23 @@ module.FileSystemLoaderUI = core.ImageGridFeatures.Feature({ actions: FileSystemLoaderUIActions, handlers: [ + // save/resore .savecomments + // + ['json', + function(res){ + if(this.savecomments != null){ + res.savecomments = this.savecomments + } + }], + ['load', + function(_, data){ + if(data.savecomments != null){ + this.savecomments = data.savecomments + } + }], + // NOTE: defining this here enables us to actually post-bind to + // an action that is defined later or may not even be + // available. ['prepareIndexForWrite', function(res){ var source = res.raw.savecomments