1
0
mirror of https://github.com/twitter/twemoji.git synced 2024-06-15 03:35:16 +00:00

Add onerror as an option

This commit is contained in:
Gary Pendergast 2015-11-14 20:42:00 +11:00
parent 9dcb7942ca
commit a77ae2c44a
5 changed files with 16 additions and 12 deletions

View File

@ -664,7 +664,7 @@ function createTwemoji(re) {
); );
if (src) { if (src) {
img = new Image(); img = new Image();
img.onerror = twemoji.onerror; img.onerror = options.onerror;
img.setAttribute('draggable', 'false'); img.setAttribute('draggable', 'false');
attrib = options.attributes(icon, variant); attrib = options.attributes(icon, variant);
for (attrname in attrib) { for (attrname in attrib) {
@ -828,7 +828,8 @@ function createTwemoji(re) {
base: typeof how.base === 'string' ? how.base : twemoji.base, base: typeof how.base === 'string' ? how.base : twemoji.base,
ext: how.ext || twemoji.ext, ext: how.ext || twemoji.ext,
size: how.folder || toSizeSquaredAsset(how.size || twemoji.size), size: how.folder || toSizeSquaredAsset(how.size || twemoji.size),
className: how.className || twemoji.className className: how.className || twemoji.className,
onerror: how.onerror || twemoji.onerror
}); });
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
twemoji.min.js vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long