From ad1d55eb9c7cbf70d5a3613259c9738d8e591110 Mon Sep 17 00:00:00 2001 From: Jacob Schatz Date: Thu, 26 May 2016 22:12:05 -0400 Subject: [PATCH] Add redo state --- app/assets/javascripts/lib/text_utility.js.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/assets/javascripts/lib/text_utility.js.coffee b/app/assets/javascripts/lib/text_utility.js.coffee index 7a115a6d8b5..75e398ddaeb 100644 --- a/app/assets/javascripts/lib/text_utility.js.coffee +++ b/app/assets/javascripts/lib/text_utility.js.coffee @@ -77,6 +77,9 @@ unique = gl.text.undoManager.addUniqueIfNotExists($thisTextarea) if not gl.text.undoManager.undoHistory[unique].length return + latestUndo = gl.text.undoManager.undoHistory[unique].pop() + gl.text.undoManager.history[unique].push(latestUndo) + $thisTextarea.val(latestUndo.newVal) gl.text.addListeners = () -> console.log('addListeners')