Skip to content

Commit

Permalink
FIX Ensure TinyMCE is correctly instantiated and removed when dom mat…
Browse files Browse the repository at this point in the history
…ching changes

Also improves the logic a little so it is easier to read
  • Loading branch information
robbieaverill committed Nov 28, 2018
1 parent 5d45c7d commit a85b7cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion client/src/legacy/HtmlEditorField.js
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ jQuery.entwine('ss', function($) {
},

onmatch: function() {
this.getEditor() || this.onadd();
if (!this.getEditor()) {
this.onadd();
}
this._super();
},

Expand All @@ -359,6 +361,13 @@ jQuery.entwine('ss', function($) {
this._super();
},

onunmatch: function() {
if (this.getEditor()) {
this.onremove();
}
this._super();
},

/**
* Make sure the editor has flushed all it's buffers before the form is submitted.
*/
Expand Down

0 comments on commit a85b7cd

Please sign in to comment.