diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-07-09 16:44:01 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-07-21 22:35:25 +0300 |
commit | 3d4d9c5ab9464954d80a7bad3cff70d49af9b74f (patch) | |
tree | 18ca0966c726885191e627ea599b239fc3833ec6 /app/assets | |
parent | d9a9c33bcafc334226d279f3f202e503543967cd (diff) |
IssueNotesRefactor: Fix adding main note awards.
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/awards_handler.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js index d6e5a1d3b57..0c884f40963 100644 --- a/app/assets/javascripts/awards_handler.js +++ b/app/assets/javascripts/awards_handler.js @@ -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'); |