From 31db970fb2bbccfdb05c4329e94cbdb8646bd967 Mon Sep 17 00:00:00 2001 From: Simon Welsh Date: Sat, 19 May 2012 15:51:09 +1200 Subject: [PATCH] BUGFIX Set Editor if getEditor() is null rather than onmatch --- javascript/HtmlEditorField.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/javascript/HtmlEditorField.js b/javascript/HtmlEditorField.js index e9ff08725..9d171f68c 100644 --- a/javascript/HtmlEditorField.js +++ b/javascript/HtmlEditorField.js @@ -354,7 +354,6 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; var titleEl = this.find(':header:first'); this.getDialog().attr('title', titleEl.text()); - this.setEditor(ss.editorWrappers['default']()); this._super(); this.redraw(); @@ -378,6 +377,19 @@ ss.editorWrappers['default'] = ss.editorWrappers.tinyMCE; updateFromEditor: function() { this.getEditor().onopen(); window._ss_htmleditorfield_bookmark = this.getEditor().createBookmark(); + }, + createEditor: function(){ + return ss.editorWrappers['default'](); + }, + /** + * Get the tinyMCE editor + */ + getEditor: function(){ + var val = this._super(); + if(!val) { + this.setEditor(val = this.createEditor()); + } + return val; } });