BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
8bb20132
Commit
8bb20132
authored
Jun 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dynamically import emoji helpers for gl-emoji custom tag prototype
parent
2874bab4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
gl_emoji.js
app/assets/javascripts/behaviors/gl_emoji.js
+12
-5
No files found.
app/assets/javascripts/behaviors/gl_emoji.js
View file @
8bb20132
import
installCustomElements
from
'document-register-element'
;
import
{
emojiImageTag
,
emojiFallbackImageSrc
}
from
'../emoji'
;
import
isEmojiUnicodeSupported
from
'../emoji/support'
;
installCustomElements
(
window
);
...
...
@@ -32,11 +31,19 @@ export default function installGlEmojiElement() {
// IE 11 doesn't like adding multiple at once :(
this
.
classList
.
add
(
'emoji-icon'
);
this
.
classList
.
add
(
fallbackSpriteClass
);
}
else
if
(
hasImageFallback
)
{
this
.
innerHTML
=
emojiImageTag
(
name
,
fallbackSrc
);
}
else
{
const
src
=
emojiFallbackImageSrc
(
name
);
this
.
innerHTML
=
emojiImageTag
(
name
,
src
);
import
(
/* webpackChunkName: 'emoji' */
'../emoji'
)
.
then
(({
emojiImageTag
,
emojiFallbackImageSrc
})
=>
{
if
(
hasImageFallback
)
{
this
.
innerHTML
=
emojiImageTag
(
name
,
fallbackSrc
);
}
else
{
const
src
=
emojiFallbackImageSrc
(
name
);
this
.
innerHTML
=
emojiImageTag
(
name
,
src
);
}
})
.
catch
(()
=>
{
// do nothing
});
}
}
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment