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
63a54021
Commit
63a54021
authored
May 30, 2016
by
Fatih Acet
Committed by
Z.J. van de Weg
Jun 06, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create and show emoji loader on the fly.
parent
f1d74ccc
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+19
-5
app/assets/stylesheets/pages/awards.scss
app/assets/stylesheets/pages/awards.scss
+2
-1
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
63a54021
...
...
@@ -100,12 +100,13 @@ class @AwardsHandler
$menu
.
css
(
css
)
addAward
:
(
votesBlock
,
awardUrl
,
emoji
,
checkMutuality
=
yes
)
->
addAward
:
(
votesBlock
,
awardUrl
,
emoji
,
checkMutuality
=
yes
,
callback
)
->
emoji
=
@
normilizeEmojiName
emoji
@
postEmoji
awardUrl
,
emoji
,
=>
@
addAwardToEmojiBar
votesBlock
,
emoji
,
checkMutuality
callback
?
()
$
(
'.emoji-menu'
).
removeClass
'is-visible'
...
...
@@ -147,10 +148,23 @@ class @AwardsHandler
if
emoji
in
[
'thumbsup'
,
'thumbsdown'
]
mutualVote
=
if
emoji
is
'thumbsup'
then
'thumbsdown'
else
'thumbsup'
selector
=
"[data-emoji=
#{
mutualVote
}
]"
$emojiButton
=
votesBlock
.
find
(
"[data-emoji=
#{
mutualVote
}
]"
).
parent
()
isAlreadyVoted
=
$emojiButton
.
hasClass
'active'
isAlreadyVoted
=
votesBlock
.
find
(
selector
).
parent
().
hasClass
'active'
@
addAward
votesBlock
,
awardUrl
,
mutualVote
,
no
if
isAlreadyVoted
if
isAlreadyVoted
@
showEmojiLoader
$emojiButton
@
addAward
votesBlock
,
awardUrl
,
mutualVote
,
no
,
->
$emojiButton
.
removeClass
'is-loading'
showEmojiLoader
:
(
$emojiButton
)
->
$loader
=
$emojiButton
.
find
'.fa-spinner'
unless
$loader
.
length
$emojiButton
.
append
'<i class="fa fa-spinner fa-spin award-control-icon award-control-icon-loading"></i>'
$emojiButton
.
addClass
'is-loading'
isActive
:
(
$emojiButton
)
->
$emojiButton
.
hasClass
'active'
...
...
app/assets/stylesheets/pages/awards.scss
View file @
63a54021
...
...
@@ -109,7 +109,8 @@
}
&
.is-loading
{
.award-control-icon-normal
{
.award-control-icon-normal
,
.emoji-icon
{
display
:
none
;
}
...
...
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