Открыть боковую панель
nt_test133
nt_project_uxpg8lvcuq8w
Коммиты
9f27b852
Коммит
9f27b852
создал
Апр 01, 2016
по автору
Jacob Schatz
Просмотр файлов
Revert "Merge branch 'users_should_not_be_able_upvote_downvote' into 'master'
This reverts merge request !3406
владелец
e3f0bef5
Изменения
2
Скрыть пробелы
Построчно
Рядом
app/assets/javascripts/awards_handler.coffee
Просмотр файла @
9f27b852
...
...
@@ -22,19 +22,8 @@ class @AwardsHandler
emoji
=
$
(
this
)
.
find
(
".icon"
)
.
data
"emoji"
if
emoji
is
"thumbsup"
and
awards_handler
.
didUserClickEmoji
$
(
this
),
"thumbsdown"
awards_handler
.
decrementCounter
"thumbsdown"
else
if
emoji
is
"thumbsdown"
and
awards_handler
.
didUserClickEmoji
$
(
this
),
"thumbsup"
awards_handler
.
decrementCounter
"thumbsup"
awards_handler
.
addAward
emoji
didUserClickEmoji
:
(
that
,
emoji
)
->
if
$
(
that
).
siblings
(
"button:has([data-emoji=
#{
emoji
}
])"
).
attr
(
"data-original-title"
)
$
(
that
).
siblings
(
"button:has([data-emoji=
#{
emoji
}
])"
).
attr
(
"data-original-title"
).
indexOf
(
'me'
)
>
-
1
showEmojiMenu
:
->
if
$
(
".emoji-menu"
).
length
if
$
(
".emoji-menu"
).
is
".is-visible"
...
...
@@ -116,7 +105,7 @@ class @AwardsHandler
if
origTitle
authors
=
origTitle
.
split
(
', '
)
authors
.
push
(
"me"
)
award_block
.
attr
(
"
data-original-
title"
,
authors
.
join
(
", "
))
award_block
.
attr
(
"title"
,
authors
.
join
(
", "
))
@
resetTooltip
(
award_block
)
resetTooltip
:
(
award
)
->
...
...
@@ -133,7 +122,7 @@ class @AwardsHandler
nodes
=
[]
nodes
.
push
(
"<button class='btn award-control js-emoji-btn has-tooltip active'
data-original-
title='me'>"
,
"<button class='btn award-control js-emoji-btn has-tooltip active' title='me'>"
,
"<div class='icon emoji-icon
#{
emojiCssClass
}
' data-emoji='
#{
emoji
}
'></div>"
,
"<span class='award-control-text js-counter'>1</span>"
,
"</button>"
...
...
app/views/votes/_votes_block.html.haml
Просмотр файла @
9f27b852
.awards.votes-block
-
awards_sort
(
votable
.
notes
.
awards
.
grouped_awards
).
each
do
|
emoji
,
notes
|
%button
.btn.award-control.js-emoji-btn.has-tooltip
{
class:
(
note_active_class
(
notes
,
current_user
)),
data:
{
placement:
"top"
,
original_
title:
emoji_author_list
(
notes
,
current_user
)}}
%button
.btn.award-control.js-emoji-btn.has-tooltip
{
class:
(
note_active_class
(
notes
,
current_user
)),
title:
emoji_author_list
(
notes
,
current_user
)
,
data:
{
placement:
"top"
}}
=
emoji_icon
(
emoji
)
%span
.award-control-text.js-counter
=
notes
.
count
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать