Make WordPress Core

Ticket #23198: 23198.3.diff

File 23198.3.diff, 760 bytes (added by adamsilverstein, 11 years ago)

cleanup as per suggestions

  • wp-admin/js/post-formats.js

     
    1212                $this.addClass('nav-tab-active').blur();
    1313                $('#post_format').val(format);
    1414                $('#post-body-content').attr('class', 'wp-format-' + format );
     15
     16                if ( typeof(tinymce) !== 'undefined' ) {
     17                        var ed = tinymce.get( 'content' ), edBody, pformat;
     18                        if ( ed && this.id ) {
     19                                edBody = ed.getBody();
     20                                pformat = 'post-format-' + this.id; // also need to handle 'post-format-0'
     21                                edBody.className = edBody.className.replace( /\bpost-format-[^ ]+/, '' );
     22                                ed.dom.addClass( edBody, format );
     23                        }
     24                }
     25
    1526        });
    1627
    1728        // Image selection