summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/awards_handler.js
diff options
context:
space:
mode:
authorKushal Pandya <kushal@gitlab.com>2018-04-05 13:54:59 +0530
committerKushal Pandya <kushal@gitlab.com>2018-04-05 13:54:59 +0530
commit1f27c6382510c91a129715642f146531b1074544 (patch)
treed37356bd7abcf2bf70227cd0283f2930d3151f63 /app/assets/javascripts/awards_handler.js
parent10143937c1fdfe2ef4628f32a1e87ca564233d17 (diff)
downloadgitlab-ce-1f27c6382510c91a129715642f146531b1074544.tar.gz
Use `isInVueNoteablePage` from dom_utils
Diffstat (limited to 'app/assets/javascripts/awards_handler.js')
-rw-r--r--app/assets/javascripts/awards_handler.js15
1 files changed, 4 insertions, 11 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
index 0e1ca7fe883..976d32abe9b 100644
--- a/app/assets/javascripts/awards_handler.js
+++ b/app/assets/javascripts/awards_handler.js
@@ -4,7 +4,8 @@ import $ from 'jquery';
import _ from 'underscore';
import Cookies from 'js-cookie';
import { __ } from './locale';
-import { isInIssuePage, isInMRPage, isInEpicPage, hasVueMRDiscussionsCookie, updateTooltipTitle } from './lib/utils/common_utils';
+import { updateTooltipTitle } from './lib/utils/common_utils';
+import { isInVueNoteablePage } from './lib/utils/dom_utils';
import flash from './flash';
import axios from './lib/utils/axios_utils';
@@ -243,7 +244,7 @@ class AwardsHandler {
addAward(votesBlock, awardUrl, emoji, checkMutuality, callback) {
const isMainAwardsBlock = votesBlock.closest('.js-noteable-awards').length;
- if (this.isInVueNoteablePage() && !isMainAwardsBlock) {
+ if (isInVueNoteablePage() && !isMainAwardsBlock) {
const id = votesBlock.attr('id').replace('note_', '');
this.hideMenuElement($('.emoji-menu'));
@@ -295,16 +296,8 @@ class AwardsHandler {
}
}
- isVueMRDiscussions() {
- return isInMRPage() && hasVueMRDiscussionsCookie() && !$('#diffs').is(':visible');
- }
-
- isInVueNoteablePage() {
- return isInIssuePage() || isInEpicPage() || this.isVueMRDiscussions();
- }
-
getVotesBlock() {
- if (this.isInVueNoteablePage()) {
+ if (isInVueNoteablePage()) {
const $el = $('.js-add-award.is-active').closest('.note.timeline-entry');
if ($el.length) {