WordPress.org

Make WordPress Core

Changeset 23790


Ignore:
Timestamp:
03/22/2013 08:43:37 PM (9 years ago)
Author:
azaozz
Message:

Editor: fix switching Text to Visual and back if TinyMCE fails to initialise, fixes #23235

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/editor.js

    r23327 r23790  
    5050                return false;
    5151
    52             if ( ed )
     52            if ( ed ) {
    5353                ed.hide();
     54            } else {
     55                // The TinyMCE instance doesn't exist, run the content through "pre_wpautop()" and show the textarea
     56                if ( tinyMCEPreInit.mceInit[id] && tinyMCEPreInit.mceInit[id].wpautop )
     57                    txtarea_el.value = t.pre_wpautop( txtarea_el.value );
     58
     59                dom.setStyles(txtarea_el, {'display': '', 'visibility': ''});
     60            }
    5461
    5562            dom.removeClass(wrap_id, 'tmce-active');
Note: See TracChangeset for help on using the changeset viewer.