From 6c74506b790be9c6d5a7d107637db1b124ea0337 Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 12 Jun 2017 12:15:36 -0500 Subject: [PATCH] Create tinymce.js When using the same tinymce editor for different rows of content (i.e. open row 1 to populate editor, close row 1, then open row 2 to populate the same editor), there is an issue where if you hit "undo" while in row 2, it will start going back to the content from row 1. I would recommend adding in a line that will refresh the undoManager when the content is re-set. --- src/tinymce.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tinymce.js b/src/tinymce.js index c0291af..4390e50 100644 --- a/src/tinymce.js +++ b/src/tinymce.js @@ -168,6 +168,7 @@ angular.module('ui.tinymce', []) tinyInstance.getDoc() ) { tinyInstance.setContent(viewValue); + tinyInstance.undoManager.clear(); // Triggering change event due to TinyMCE not firing event & // becoming out of sync for change callbacks tinyInstance.fire('change');