From 6a1d0cf0db73e26ce6188ee2c516f72392a1be34 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 7 Nov 2015 22:32:24 +0300 Subject: [PATCH] fixed menu capturing and losing crop state bug... Signed-off-by: Alex A. Naanou --- ui (gen4)/viewer.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/ui (gen4)/viewer.js b/ui (gen4)/viewer.js index 7af765da..690f11d3 100755 --- a/ui (gen4)/viewer.js +++ b/ui (gen4)/viewer.js @@ -2342,7 +2342,18 @@ var makeActionLister = function(list, filter, pre_order){ return o } - return a[n].apply(a, arguments) + var res = a[n].apply(a, arguments) + + // cleanup -- restore data that was updated by action... + // NOTE: we do not need to worry about partial + // updates as they are done in place... + Object.keys(a).forEach(function(n){ + if(n != 'preventClosing'){ + that[n] = a[n] + } + }) + + return res } // ignore args of actions... } else { @@ -2354,7 +2365,18 @@ var makeActionLister = function(list, filter, pre_order){ return o } - return a[n]() + var res = a[n]() + + // cleanup -- restore data that was updated by action... + // NOTE: we do not need to worry about partial + // updates as they are done in place... + Object.keys(a).forEach(function(n){ + if(n != 'preventClosing'){ + that[n] = a[n] + } + }) + + return res } } })