Make WordPress Core

Changeset 31898


Ignore:
Timestamp:
03/26/2015 02:39:46 AM (10 years ago)
Author:
azaozz
Message:

Fix initialization of wp-emoji in IE8.
Props pento, azaozz. Fixes #31701.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/js/wp-emoji.js

    r31875 r31898  
    3131        replaceEmoji = false,
    3232
     33        isIE8 = window.navigator.userAgent.indexOf( 'IE 8' ) !== -1,
     34
    3335        // Private
    3436        twemoji, timer,
     
    4749                }
    4850
    49                 // Still waiting. 
     51                // Still waiting.
    5052                window.clearTimeout( timer );
    5153                timer = window.setTimeout( load, 50 );
     
    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            }
     
    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 );
Note: See TracChangeset for help on using the changeset viewer.