mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-17 03:56:07 +00:00
Editor: fix switching Text to Visual and back if TinyMCE fails to initialise, fixes #23235
git-svn-id: http://core.svn.wordpress.org/trunk@23790 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b4dbe1907d
commit
4064312308
@ -49,8 +49,15 @@ var switchEditors = {
|
|||||||
if ( ed && ed.isHidden() )
|
if ( ed && ed.isHidden() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ( ed )
|
if ( ed ) {
|
||||||
ed.hide();
|
ed.hide();
|
||||||
|
} else {
|
||||||
|
// The TinyMCE instance doesn't exist, run the content through "pre_wpautop()" and show the textarea
|
||||||
|
if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
|
||||||
|
txtarea_el.value = t.pre_wpautop( txtarea_el.value );
|
||||||
|
|
||||||
|
dom.setStyles(txtarea_el, {'display': '', 'visibility': ''});
|
||||||
|
}
|
||||||
|
|
||||||
dom.removeClass(wrap_id, 'tmce-active');
|
dom.removeClass(wrap_id, 'tmce-active');
|
||||||
dom.addClass(wrap_id, 'html-active');
|
dom.addClass(wrap_id, 'html-active');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user