From ca75a1dc9440ffa61581b5f50572966730870acc Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 9 Aug 2013 16:42:41 +0000 Subject: [PATCH] rewrite history on join and split (added items will have new ids) --- static/js/utils.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/static/js/utils.js b/static/js/utils.js index dd9c42d5..f40e862c 100644 --- a/static/js/utils.js +++ b/static/js/utils.js @@ -323,8 +323,8 @@ pandora.createLinks = function($element) { action: action, items: action == 'cut' || action == 'delete' ? [items] : action == 'copy' || action == 'paste' ? [addedItems] - : action == 'move' ? [items, addedItems] - : [items], + : action == 'join' || action == 'split' ? [items[0], addedItems] + : [items, addedItems], // move positions: [], targets: targets, text: text @@ -350,7 +350,10 @@ pandora.createLinks = function($element) { }); } } - function done() { + function done(result, addedItems) { + if (object.action == 'join' || object.action == 'split') { + object.items[1] = addedItems; + } doneHistory(object, callback); } }; @@ -372,7 +375,10 @@ pandora.createLinks = function($element) { }); } } - function done() { + function done(result, addedItems) { + if (object.action == 'join' || object.action == 'split') { + object.items[0] = addedItems; + } doneHistory(object, callback); } };