Update Twemoji to 1.3.0.

Includes a fix for Firefox: https://github.com/twitter/twemoji/commit/92d5bea1abf0183fd00d306511c541b55b414959
Since this fix breaks IE 11 we added `modified = false;` after `subnode.parentNode.replaceChild(fragment, subnode)`.

props iseulde.
see #31242.

git-svn-id: https://develop.svn.wordpress.org/trunk@31758 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90)
2015-03-12 21:59:04 +00:00
parent ba3a48766e
commit c8cd080d1b
2 changed files with 9 additions and 6 deletions
+8 -5
View File
@@ -1,6 +1,5 @@
/*jslint indent: 2, browser: true, bitwise: true, plusplus: true */
var twemoji;
twemoji = (function (
var twemoji = (function (
/*! Copyright Twitter Inc. and other contributors. Licensed under MIT *//*
https://github.com/twitter/twemoji/blob/gh-pages/LICENSE
*/
@@ -327,6 +326,7 @@ twemoji = (function (
var
allText = grabAllTextNodes(node, []),
length = allText.length,
modified = false,
fragment,
subnode,
text,
@@ -367,13 +367,15 @@ twemoji = (function (
img.setAttribute('draggable', 'false');
img.alt = alt;
img.src = src;
modified = true;
fragment.appendChild(img);
}
}
fragment.appendChild(img || createText(alt));
if (!img) fragment.appendChild(createText(alt));
img = null;
}
// is there actually anything to replace in here ?
if (img) {
img = null;
if (modified) {
// any text left to be added ?
if (i < text.length) {
fragment.appendChild(
@@ -383,6 +385,7 @@ twemoji = (function (
// replace the text node only, leave intact
// anything else surrounding such text
subnode.parentNode.replaceChild(fragment, subnode);
modified = false;
}
}
return node;