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
Boxiang Sun
gitlab-ce
Commits
25a48932
Commit
25a48932
authored
Mar 31, 2016
by
Phil Hughes
Committed by
Fatih Acet
May 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes buttons in notes body
parent
f2f2e072
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
26 deletions
+30
-26
app/assets/javascripts/awards_handler.coffee
app/assets/javascripts/awards_handler.coffee
+30
-26
No files found.
app/assets/javascripts/awards_handler.coffee
View file @
25a48932
...
...
@@ -2,11 +2,13 @@ class @AwardsHandler
constructor
:
->
@
aliases
=
emojiAliases
()
$
(
document
).
on
"click"
,
".js-add-award"
,
(
event
)
=>
event
.
stopPropagation
()
event
.
preventDefault
()
$
(
document
)
.
off
"click"
,
".js-add-award"
.
on
"click"
,
".js-add-award"
,
(
event
)
=>
event
.
stopPropagation
()
event
.
preventDefault
()
@
showEmojiMenu
$
(
event
.
currentTarget
)
@
showEmojiMenu
$
(
event
.
currentTarget
)
$
(
"html"
).
on
'click'
,
(
event
)
->
if
!
$
(
event
.
target
).
closest
(
".emoji-menu"
).
length
...
...
@@ -72,40 +74,42 @@ class @AwardsHandler
@
addEmojiToFrequentlyUsedList
(
emoji
)
emoji
=
@
normilizeEmojiName
(
emoji
)
$emojiBtn
=
@
findEmojiIcon
(
emoji
)
$emojiBtn
=
@
findEmojiIcon
(
emoji
)
.
parent
()
if
$emojiBtn
.
length
>
0
if
@
isActive
(
$emojiBtn
)
@
decrementCounter
(
emoji
)
@
decrementCounter
(
$emojiBtn
,
emoji
)
else
counter
=
@
findEmojiIcon
(
emoji
)
.
siblings
(
".js-counter"
)
counter
=
$emojiBtn
.
siblings
(
".js-counter"
)
counter
.
text
(
parseInt
(
counter
.
text
())
+
1
)
counter
.
parent
()
.
addClass
(
"active"
)
$emojiBtn
.
addClass
(
"active"
)
@
addMeToUserList
(
emoji
)
else
@
createEmoji
(
emoji
)
isActive
:
(
$emojiBtn
)
->
$emojiBtn
.
parent
().
hasClass
(
"active"
)
decrementCounter
:
(
emoji
)
->
counter
=
@
findEmojiIcon
(
emoji
).
siblings
(
".js-counter"
)
emojiIcon
=
counter
.
parent
(
)
if
parseInt
(
counter
.
text
())
>
1
counter
.
text
(
parseInt
(
counter
.
text
())
-
1
)
emojiIcon
.
removeClass
(
"active"
)
@
removeMeFromUserList
(
emoji
)
else
if
emoji
==
"thumbsup"
||
emoji
==
"thumbsdown"
emojiIcon
.
tooltip
(
"destroy"
)
counter
.
text
(
0
)
emojiIcon
.
removeClass
(
"active"
)
@
removeMeFromUserList
(
emoji
)
$emojiBtn
.
hasClass
(
"active"
)
decrementCounter
:
(
$emojiBtn
,
emoji
)
->
isntNoteBody
=
$emojiBtn
.
closest
(
'.note-body'
).
length
is
0
counter
=
$
(
'.js-counter'
,
$emojiBtn
)
counterNumber
=
parseInt
(
counter
.
text
())
if
counterNumber
>
1
counter
.
text
(
counterNumber
-
1
)
@
removeMeFromUserList
(
$emojiBtn
,
emoji
)
else
if
(
emoji
==
"thumbsup"
||
emoji
==
"thumbsdown"
)
&&
isntNoteBody
$emojiBtn
.
tooltip
(
"destroy"
)
counter
.
text
(
'0'
)
@
removeMeFromUserList
(
$emojiBtn
,
emoji
)
else
emojiIco
n
.
tooltip
(
"destroy"
)
emojiIco
n
.
remove
()
$emojiBt
n
.
tooltip
(
"destroy"
)
$emojiBt
n
.
remove
()
removeMeFromUserList
:
(
emoji
)
->
award_block
=
@
findEmojiIcon
(
emoji
).
parent
()
$emojiBtn
.
removeClass
(
"active"
)
removeMeFromUserList
:
(
$emojiBtn
,
emoji
)
->
award_block
=
$emojiBtn
authors
=
award_block
.
attr
(
"data-original-title"
)
.
split
(
", "
)
...
...
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