Fix initialization of wp-emoji in IE8.
Props pento, azaozz. Fixes #31701. git-svn-id: https://develop.svn.wordpress.org/trunk@31898 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
359ba47700
commit
2c2a69c2a7
|
@ -30,6 +30,8 @@
|
|||
*/
|
||||
replaceEmoji = false,
|
||||
|
||||
isIE8 = window.navigator.userAgent.indexOf( 'IE 8' ) !== -1,
|
||||
|
||||
// Private
|
||||
twemoji, timer,
|
||||
count = 0;
|
||||
|
@ -46,7 +48,7 @@
|
|||
return;
|
||||
}
|
||||
|
||||
// Still waiting.
|
||||
// Still waiting.
|
||||
window.clearTimeout( timer );
|
||||
timer = window.setTimeout( load, 50 );
|
||||
count++;
|
||||
|
@ -131,7 +133,7 @@
|
|||
|
||||
// Load when the readyState changes to 'interactive', not 'complete'.
|
||||
function onLoad() {
|
||||
if ( 'interactive' === document.readyState ) {
|
||||
if ( ( ! isIE8 && 'interactive' === document.readyState ) || ( isIE8 && 'complete' === document.readyState ) ) {
|
||||
load();
|
||||
}
|
||||
}
|
||||
|
@ -144,7 +146,7 @@
|
|||
supportsFlagEmoji = window._wpemojiSettings.supports.flag;
|
||||
replaceEmoji = ! supportsEmoji || ! supportsFlagEmoji;
|
||||
|
||||
if ( 'loading' == document.readyState ) {
|
||||
if ( ( ! isIE8 && 'loading' === document.readyState ) || ( isIE8 && 'complete' !== document.readyState ) ) {
|
||||
if ( document.addEventListener ) {
|
||||
document.addEventListener( 'readystatechange', onLoad, false );
|
||||
} else if ( document.attachEvent ) {
|
||||
|
|
Loading…
Reference in New Issue