Breaks TinyMCE when enabled in WP version 3.9.1 (fix included)
-
In editor_plugin.js the following JavaScript is breaking the post editor in WordPress 3.9.1
tinyMCE.dom.Event.add(editBtn, 'mousedown', function(e) { t._hideButtons(); var ed = tinyMCE.activeEditor, el = ed.selection.getNode(); ed.execCommand('mceMediaCoreChooser'); return false; }); tinyMCE.dom.Event.add(deleteBtn, 'mousedown', function(e) { var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), parent; if (el.nodeName == 'IMG' && ed.dom.hasClass(el, t.btnClass)) { t._hideButtons(); parent = el.parentNode; ed.dom.remove(el); ed.execCommand('repaint'); //ed.selection.select(parent); return false; } });
The following fixes that:
tinyMCE.dom.Event.bind(editBtn, 'mousedown', function(e) { t._hideButtons(); var ed = tinyMCE.activeEditor, el = ed.selection.getNode(); ed.execCommand('mceMediaCoreChooser'); return false; }); tinyMCE.dom.Event.bind(deleteBtn, 'mousedown', function(e) { var ed = tinyMCE.activeEditor, el = ed.selection.getNode(), parent; if (el.nodeName == 'IMG' && ed.dom.hasClass(el, t.btnClass)) { t._hideButtons(); parent = el.parentNode; ed.dom.remove(el); ed.execCommand('repaint'); //ed.selection.select(parent); return false; } });
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Breaks TinyMCE when enabled in WP version 3.9.1 (fix included)’ is closed to new replies.