some tweaking...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2022-02-07 03:27:06 +03:00
parent 48551ba39a
commit b384d1f879

View File

@ -2003,11 +2003,11 @@ var JournalActions = actions.Actions({
action: action, action: action,
args: [...arguments], args: [...arguments],
current: this.current, current: this.current,
// set in the post handler... // NOTE: we set this after the action is done...
target: undefined, target: undefined,
} }
// get action method handling aliases... // helper: get action method handling aliases...
var _getActionMethod = function(action, attr){ var _getActionMethod = function(action, attr){
var meth = that.getActionAttr(action, attr) var meth = that.getActionAttr(action, attr)
while(typeof(meth) == typeof('str')){ while(typeof(meth) == typeof('str')){
@ -2018,12 +2018,13 @@ var JournalActions = actions.Actions({
var test = _getActionMethod(action, 'undoable') var test = _getActionMethod(action, 'undoable')
if(test && !test.call(that, data)){ if(test && !test.call(that, data)){
return } return }
// prep to get additional undo state...
var update = _getActionMethod(action, 'getUndoState')
// journal after the action is done... // journal after the action is done...
return function(){ return function(){
data.target = this.current data.target = this.current
// prep to get additional undo state...
var update = _getActionMethod(action, 'getUndoState')
update update
&& update instanceof Function && update instanceof Function
&& update.call(that, data) && update.call(that, data)