IssueNotesRefactor: Fix adding main note awards.
This commit is contained in:
parent
d9a9c33bca
commit
3d4d9c5ab9
|
@ -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?
|
||||
|
|
Loading…
Reference in New Issue