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
iv
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
...
@@ -2,11 +2,13 @@ class @AwardsHandler
constructor
:
->
constructor
:
->
@
aliases
=
emojiAliases
()
@
aliases
=
emojiAliases
()
$
(
document
).
on
"click"
,
".js-add-award"
,
(
event
)
=>
$
(
document
)
event
.
stopPropagation
()
.
off
"click"
,
".js-add-award"
event
.
preventDefault
()
.
on
"click"
,
".js-add-award"
,
(
event
)
=>
event
.
stopPropagation
()
event
.
preventDefault
()
@
showEmojiMenu
$
(
event
.
currentTarget
)
@
showEmojiMenu
$
(
event
.
currentTarget
)
$
(
"html"
).
on
'click'
,
(
event
)
->
$
(
"html"
).
on
'click'
,
(
event
)
->
if
!
$
(
event
.
target
).
closest
(
".emoji-menu"
).
length
if
!
$
(
event
.
target
).
closest
(
".emoji-menu"
).
length
...
@@ -72,40 +74,42 @@ class @AwardsHandler
...
@@ -72,40 +74,42 @@ class @AwardsHandler
@
addEmojiToFrequentlyUsedList
(
emoji
)
@
addEmojiToFrequentlyUsedList
(
emoji
)
emoji
=
@
normilizeEmojiName
(
emoji
)
emoji
=
@
normilizeEmojiName
(
emoji
)
$emojiBtn
=
@
findEmojiIcon
(
emoji
)
$emojiBtn
=
@
findEmojiIcon
(
emoji
)
.
parent
()
if
$emojiBtn
.
length
>
0
if
$emojiBtn
.
length
>
0
if
@
isActive
(
$emojiBtn
)
if
@
isActive
(
$emojiBtn
)
@
decrementCounter
(
emoji
)
@
decrementCounter
(
$emojiBtn
,
emoji
)
else
else
counter
=
@
findEmojiIcon
(
emoji
)
.
siblings
(
".js-counter"
)
counter
=
$emojiBtn
.
siblings
(
".js-counter"
)
counter
.
text
(
parseInt
(
counter
.
text
())
+
1
)
counter
.
text
(
parseInt
(
counter
.
text
())
+
1
)
counter
.
parent
()
.
addClass
(
"active"
)
$emojiBtn
.
addClass
(
"active"
)
@
addMeToUserList
(
emoji
)
@
addMeToUserList
(
emoji
)
else
else
@
createEmoji
(
emoji
)
@
createEmoji
(
emoji
)
isActive
:
(
$emojiBtn
)
->
isActive
:
(
$emojiBtn
)
->
$emojiBtn
.
parent
().
hasClass
(
"active"
)
$emojiBtn
.
hasClass
(
"active"
)
decrementCounter
:
(
emoji
)
->
decrementCounter
:
(
$emojiBtn
,
emoji
)
->
counter
=
@
findEmojiIcon
(
emoji
).
siblings
(
".js-counter"
)
isntNoteBody
=
$emojiBtn
.
closest
(
'.note-body'
).
length
is
0
emojiIcon
=
counter
.
parent
(
)
counter
=
$
(
'.js-counter'
,
$emojiBtn
)
if
parseInt
(
counter
.
text
())
>
1
counterNumber
=
parseInt
(
counter
.
text
())
counter
.
text
(
parseInt
(
counter
.
text
())
-
1
)
emojiIcon
.
removeClass
(
"active"
)
if
counterNumber
>
1
@
removeMeFromUserList
(
emoji
)
counter
.
text
(
counterNumber
-
1
)
else
if
emoji
==
"thumbsup"
||
emoji
==
"thumbsdown"
@
removeMeFromUserList
(
$emojiBtn
,
emoji
)
emojiIcon
.
tooltip
(
"destroy"
)
else
if
(
emoji
==
"thumbsup"
||
emoji
==
"thumbsdown"
)
&&
isntNoteBody
counter
.
text
(
0
)
$emojiBtn
.
tooltip
(
"destroy"
)
emojiIcon
.
removeClass
(
"active"
)
counter
.
text
(
'0'
)
@
removeMeFromUserList
(
emoji
)
@
removeMeFromUserList
(
$emojiBtn
,
emoji
)
else
else
emojiIco
n
.
tooltip
(
"destroy"
)
$emojiBt
n
.
tooltip
(
"destroy"
)
emojiIco
n
.
remove
()
$emojiBt
n
.
remove
()
removeMeFromUserList
:
(
emoji
)
->
$emojiBtn
.
removeClass
(
"active"
)
award_block
=
@
findEmojiIcon
(
emoji
).
parent
()
removeMeFromUserList
:
(
$emojiBtn
,
emoji
)
->
award_block
=
$emojiBtn
authors
=
award_block
authors
=
award_block
.
attr
(
"data-original-title"
)
.
attr
(
"data-original-title"
)
.
split
(
", "
)
.
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