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
Léo-Paul Géneau
gitlab-ce
Commits
1d7c3c79
Commit
1d7c3c79
authored
May 24, 2016
by
Fatih Acet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle thumbsup and thumbsdown mutuality.
parent
5b046f85
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+8
-0
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
1d7c3c79
...
...
@@ -24,6 +24,7 @@ class @AwardsHandler
handleClick
:
(
e
)
=>
e
.
preventDefault
()
$emojiBtn
=
$
(
e
.
currentTarget
)
$addAwardBtn
=
$
(
'.js-add-award.is-active'
)
$votesBlock
=
$
(
$addAwardBtn
.
closest
(
'.js-award-holder'
).
data
(
'target'
))
...
...
@@ -36,6 +37,13 @@ class @AwardsHandler
$votesBlock
.
addClass
'js-awards-block'
awardUrl
=
$votesBlock
.
data
'award-url'
emoji
=
$emojiBtn
.
find
(
'.icon'
).
data
(
'emoji'
)
if
emoji
in
[
'thumbsup'
,
'thumbsdown'
]
mutualVote
=
if
emoji
is
'thumbsup'
then
'thumbsdown'
else
'thumbsup'
isAlreadyVoted
=
$
(
"[data-emoji=
#{
mutualVote
}
]"
).
parent
().
hasClass
'active'
@
addAward
awardUrl
,
mutualVote
if
isAlreadyVoted
@
addAward
awardUrl
,
emoji
...
...
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