Make WordPress Core

Ticket #31701: 31701.13.diff

File 31701.13.diff, 1.3 KB (added by azaozz, 10 years ago)
  • src/wp-includes/js/wp-emoji.js

     
    3030                 */
    3131                replaceEmoji = false,
    3232
     33                isIE8 = window.navigator.userAgent.indexOf( 'IE 8' ) !== -1,
     34
    3335                // Private
    3436                twemoji, timer,
    3537                count = 0;
     
    4648                                        return;
    4749                                }
    4850
    49                                 // Still waiting. 
     51                                // Still waiting.
    5052                                window.clearTimeout( timer );
    5153                                timer = window.setTimeout( load, 50 );
    5254                                count++;
     
    131133
    132134                // Load when the readyState changes to 'interactive', not 'complete'.
    133135                function onLoad() {
    134                         if ( 'interactive' === document.readyState ) {
     136                        if ( ( ! isIE8 && 'interactive' === document.readyState ) || ( isIE8 && 'complete' === document.readyState ) ) {
    135137                                load();
    136138                        }
    137139                }
     
    144146                        supportsFlagEmoji = window._wpemojiSettings.supports.flag;
    145147                        replaceEmoji = ! supportsEmoji || ! supportsFlagEmoji;
    146148
    147                         if ( 'loading' == document.readyState ) {
     149                        if ( ( ! isIE8 && 'loading' === document.readyState ) || ( isIE8 && 'complete' !== document.readyState ) ) {
    148150                                if ( document.addEventListener ) {
    149151                                        document.addEventListener( 'readystatechange', onLoad, false );
    150152                                } else if ( document.attachEvent ) {