Make WordPress Core

Changeset 31761


Ignore:
Timestamp:
03/12/2015 10:59:41 PM (10 years ago)
Author:
azaozz
Message:

TinyMCE: fix emoji parsing in IE. See #31242.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/tinymce/plugins/wpemoji/plugin.js

    r31750 r31761  
    11( function( tinymce, wp ) {
    22    tinymce.PluginManager.add( 'wpemoji', function( editor, url ) {
    3         var typing;
     3        var typing
     4            isMacWebKit = tinymce.Env.mac && tinymce.Env.webkit;
    45
    56        if ( ! wp.emoji.parseEmoji ) {
     
    3132            selection = editor.selection;
    3233            node = selection.getNode();
    33             bookmark = selection.getBookmark();
     34
     35            if ( isMacWebKit ) {
     36                bookmark = selection.getBookmark();
     37            }
    3438
    3539            wp.emoji.parse( node );
     
    4549            } );
    4650
    47             selection.moveToBookmark( bookmark );
     51            // In IE all content in the editor is left selected aftrer wp.emoji.parse()...
     52            // Collapse the selection to the beginning.
     53            if ( tinymce.Env.ie && node && node.nodeName === 'BODY' ) {
     54                selection.collapse( true );
     55            }
     56
     57            if ( isMacWebKit ) {
     58                selection.moveToBookmark( bookmark );
     59            }
    4860        } );
    4961
Note: See TracChangeset for help on using the changeset viewer.