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
c9ba4f76
Commit
c9ba4f76
authored
Feb 04, 2019
by
Tim Zallmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved Class to its own class
parent
17ad4f8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
47 deletions
+42
-47
app/assets/javascripts/behaviors/gl_emoji.js
app/assets/javascripts/behaviors/gl_emoji.js
+42
-47
No files found.
app/assets/javascripts/behaviors/gl_emoji.js
View file @
c9ba4f76
import
'
document-register-element
'
;
import
'
document-register-element
'
;
import
isEmojiUnicodeSupported
from
'
../emoji/support
'
;
import
isEmojiUnicodeSupported
from
'
../emoji/support
'
;
export
default
function
installGlEmojiElement
()
{
class
GlEmoji
extends
HTMLElement
{
if
(
!
customElements
.
get
(
'
gl-emoji
'
))
{
customElements
.
define
(
'
gl-emoji
'
,
class
extends
HTMLElement
{
constructor
()
{
constructor
()
{
super
();
super
();
...
@@ -18,11 +14,7 @@ export default function installGlEmojiElement() {
...
@@ -18,11 +14,7 @@ export default function installGlEmojiElement() {
const
hasImageFallback
=
fallbackSrc
&&
fallbackSrc
.
length
>
0
;
const
hasImageFallback
=
fallbackSrc
&&
fallbackSrc
.
length
>
0
;
const
hasCssSpriteFalback
=
fallbackSpriteClass
&&
fallbackSpriteClass
.
length
>
0
;
const
hasCssSpriteFalback
=
fallbackSpriteClass
&&
fallbackSpriteClass
.
length
>
0
;
if
(
if
(
emojiUnicode
&&
isEmojiUnicode
&&
!
isEmojiUnicodeSupported
(
emojiUnicode
,
unicodeVersion
))
{
emojiUnicode
&&
isEmojiUnicode
&&
!
isEmojiUnicodeSupported
(
emojiUnicode
,
unicodeVersion
)
)
{
// CSS sprite fallback takes precedence over image fallback
// CSS sprite fallback takes precedence over image fallback
if
(
hasCssSpriteFalback
)
{
if
(
hasCssSpriteFalback
)
{
if
(
!
gon
.
emoji_sprites_css_added
&&
gon
.
emoji_sprites_css_path
)
{
if
(
!
gon
.
emoji_sprites_css_added
&&
gon
.
emoji_sprites_css_path
)
{
...
@@ -51,7 +43,10 @@ export default function installGlEmojiElement() {
...
@@ -51,7 +43,10 @@ export default function installGlEmojiElement() {
}
}
}
}
}
}
},
}
);
export
default
function
installGlEmojiElement
()
{
if
(
!
customElements
.
get
(
'
gl-emoji
'
))
{
customElements
.
define
(
'
gl-emoji
'
,
GlEmoji
);
}
}
}
}
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