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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
a2a276a8
Commit
a2a276a8
authored
Jun 27, 2017
by
Mike Greiling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rename getEmojiCategoryMap and remove unnecessary parameter
parent
9d6bbc92
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
app/assets/javascripts/awards_handler.js
app/assets/javascripts/awards_handler.js
+2
-2
app/assets/javascripts/emoji/index.js
app/assets/javascripts/emoji/index.js
+7
-7
No files found.
app/assets/javascripts/awards_handler.js
View file @
a2a276a8
...
...
@@ -133,7 +133,7 @@ export default class AwardsHandler {
this
.
isCreatingEmojiMenu
=
true
;
// Render the first category
const
categoryMap
=
Emoji
.
getEmoji
ByCategory
();
const
categoryMap
=
Emoji
.
getEmoji
CategoryMap
();
const
categoryNameKey
=
Object
.
keys
(
categoryMap
)[
0
];
const
emojisInCategory
=
categoryMap
[
categoryNameKey
];
const
firstCategory
=
renderCategory
(
categoryLabelMap
[
categoryNameKey
],
emojisInCategory
);
...
...
@@ -173,7 +173,7 @@ export default class AwardsHandler {
}
this
.
isAddingRemainingEmojiMenuCategories
=
true
;
const
categoryMap
=
Emoji
.
getEmoji
ByCategory
();
const
categoryMap
=
Emoji
.
getEmoji
CategoryMap
();
// Avoid the jank and render the remaining categories separately
// This will take more time, but makes UI more responsive
...
...
app/assets/javascripts/emoji/index.js
View file @
a2a276a8
...
...
@@ -20,10 +20,10 @@ export function filterEmojiNamesByAlias(filter) {
return
_
.
uniq
(
filterEmojiNames
(
filter
).
map
(
name
=>
normalizeEmojiName
(
name
)));
}
let
emoji
ByCategory
;
export
function
getEmoji
ByCategory
(
category
=
null
)
{
if
(
!
emoji
ByCategory
)
{
emoji
ByCategory
=
{
let
emoji
CategoryMap
;
export
function
getEmoji
CategoryMap
(
)
{
if
(
!
emoji
CategoryMap
)
{
emoji
CategoryMap
=
{
activity
:
[],
people
:
[],
nature
:
[],
...
...
@@ -35,12 +35,12 @@ export function getEmojiByCategory(category = null) {
};
Object
.
keys
(
emojiMap
).
forEach
((
name
)
=>
{
const
emoji
=
emojiMap
[
name
];
if
(
emoji
ByCategory
[
emoji
.
category
])
{
emoji
ByCategory
[
emoji
.
category
].
push
(
name
);
if
(
emoji
CategoryMap
[
emoji
.
category
])
{
emoji
CategoryMap
[
emoji
.
category
].
push
(
name
);
}
});
}
return
category
?
emojiByCategory
[
category
]
:
emojiByCategory
;
return
emojiCategoryMap
;
}
export
function
getEmojiInfo
(
query
)
{
...
...
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