From 9ac94fc4ac5ca70f98b9638df19b3bf5dc740a5b Mon Sep 17 00:00:00 2001 From: cahrens Date: Mon, 17 Mar 2014 14:47:13 -0400 Subject: [PATCH] Fire events when CodeMirror Editor is open and closed. Needed to switch static links back and forth. --- .../js/vendor/tiny_mce/plugins/codemirror/source.html | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/common/static/js/vendor/tiny_mce/plugins/codemirror/source.html b/common/static/js/vendor/tiny_mce/plugins/codemirror/source.html index 18b18f6d24..06f1e70fc1 100644 --- a/common/static/js/vendor/tiny_mce/plugins/codemirror/source.html +++ b/common/static/js/vendor/tiny_mce/plugins/codemirror/source.html @@ -126,6 +126,9 @@ function start() CodeMirror.defineInitHook(function(inst) { + // EDX: added to switch static links. + editor.fire("ShowCodeMirror", inst); + // Move cursor to correct position: inst.focus(); var cursor = inst.getSearchCursor(String.fromCharCode(chr), false); @@ -194,6 +197,10 @@ function submit() } // Submit HTML to TinyMCE: + + // EDX: added to switch static links. + editor.fire('SaveCodeMirror', codemirror); + editor.setContent(codemirror.getValue().replace(cc, '')); editor.isNotDirty = !isDirty; if (isDirty) {