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
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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+19
-5
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'
...
...
@@ -146,11 +147,24 @@ class @AwardsHandler
awardUrl
=
@
getAwardUrl
()
if
emoji
in
[
'thumbsup'
,
'thumbsdown'
]
mutualVote
=
if
emoji
is
'thumbsup'
then
'thumbsdown'
else
'thumbsup'
selector
=
"[data-emoji=
#{
mutualVote
}
]"
mutualVote
=
if
emoji
is
'thumbsup'
then
'thumbsdown'
else
'thumbsup'
$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