Commit 3d4d9c5a authored by Fatih Acet's avatar Fatih Acet

IssueNotesRefactor: Fix adding main note awards.

parent d9a9c33b
......@@ -235,7 +235,9 @@ class AwardsHandler {
}
addAward(votesBlock, awardUrl, emoji, checkMutuality, callback) {
if (this.isInIssuePage()) {
const isMainAwardsBlock = votesBlock.closest('.js-issue-note-awards').length;
if (this.isInIssuePage() && !isMainAwardsBlock) {
const id = votesBlock[0].id.replace('note_', '');
$('.emoji-menu').removeClass('is-visible');
......@@ -288,7 +290,11 @@ class AwardsHandler {
getVotesBlock() {
if (this.isInIssuePage()) {
return $('.js-add-award.is-active').closest('.note.timeline-entry');
const $el = $('.js-add-award.is-active').closest('.note.timeline-entry');
if ($el.length) {
return $el;
}
}
const currentBlock = $('.js-awards-block.current');
......
......@@ -72,7 +72,7 @@
.content-block.emoji-block
.row
.col-sm-8
.col-sm-8.js-issue-note-awards
= render 'award_emoji/awards_block', awardable: @issue, inline: true
.col-sm-4.new-branch-col
= render 'new_branch' unless @issue.confidential?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment