Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
app/assets/javascripts/behaviors/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
installCustomElements
from
'
document-register-element
'
;
import
{
emojiImageTag
,
emojiFallbackImageSrc
}
from
'
../emoji
'
;
import
isEmojiUnicodeSupported
from
'
../emoji/support
'
;
import
isEmojiUnicodeSupported
from
'
../emoji/support
'
;
installCustomElements
(
window
);
installCustomElements
(
window
);
...
@@ -32,11 +31,19 @@ export default function installGlEmojiElement() {
...
@@ -32,11 +31,19 @@ export default function installGlEmojiElement() {
// IE 11 doesn't like adding multiple at once :(
// IE 11 doesn't like adding multiple at once :(
this
.
classList
.
add
(
'
emoji-icon
'
);
this
.
classList
.
add
(
'
emoji-icon
'
);
this
.
classList
.
add
(
fallbackSpriteClass
);
this
.
classList
.
add
(
fallbackSpriteClass
);
}
else
if
(
hasImageFallback
)
{
this
.
innerHTML
=
emojiImageTag
(
name
,
fallbackSrc
);
}
else
{
}
else
{
const
src
=
emojiFallbackImageSrc
(
name
);
import
(
/* webpackChunkName: 'emoji' */
'
../emoji
'
)
this
.
innerHTML
=
emojiImageTag
(
name
,
src
);
.
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