summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2017-08-01 18:23:42 +0100
committerFilipa Lacerda <filipa@gitlab.com>2017-08-01 18:23:59 +0100
commit7a98970bd84b8f42bc117040cc284a73cbf03a8a (patch)
tree3cdd930d6f8c246a97534ab2702a535a8cc58ab6 /app/assets/javascripts
parent335d4a535f737f19ef4959ec4027681d97d1002b (diff)
downloadgitlab-ce-7a98970bd84b8f42bc117040cc284a73cbf03a8a.tar.gz
[ci skip] Removes Vue from awards handler code
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/awards_handler.js9
-rw-r--r--app/assets/javascripts/dispatcher.js1
-rw-r--r--app/assets/javascripts/notes/components/issue_notes_app.vue4
3 files changed, 9 insertions, 5 deletions
diff --git a/app/assets/javascripts/awards_handler.js b/app/assets/javascripts/awards_handler.js
index 394e2fae567..ae0a742340d 100644
--- a/app/assets/javascripts/awards_handler.js
+++ b/app/assets/javascripts/awards_handler.js
@@ -2,7 +2,6 @@
/* global Flash */
import Cookies from 'js-cookie';
-import issueNotesEventHub from './notes/event_hub';
const animationEndEventString = 'animationend webkitAnimationEnd MSAnimationEnd oAnimationEnd';
const transitionEndEventString = 'transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd';
@@ -242,8 +241,14 @@ class AwardsHandler {
$('.emoji-menu').removeClass('is-visible');
$('.js-add-award.is-active').removeClass('is-active');
+ const toggleAwardEvent = new CustomEvent('toggleAward', {
+ detail: {
+ awardName: emoji,
+ noteId: id,
+ },
+ });
- return issueNotesEventHub.$emit('toggleAward', { awardName: emoji, noteId: id });
+ document.querySelector('.js-vue-notes-event').dispatchEvent(toggleAwardEvent);
}
const normalizedEmoji = this.emoji.normalizeEmojiName(emoji);
diff --git a/app/assets/javascripts/dispatcher.js b/app/assets/javascripts/dispatcher.js
index a2664c0301e..3a328a62558 100644
--- a/app/assets/javascripts/dispatcher.js
+++ b/app/assets/javascripts/dispatcher.js
@@ -170,7 +170,6 @@ import GpgBadges from './gpg_badges';
shortcut_handler = new ShortcutsIssuable();
new ZenMode();
initIssuableSidebar();
- initNotes();
break;
case 'dashboard:milestones:index':
new ProjectSelect();
diff --git a/app/assets/javascripts/notes/components/issue_notes_app.vue b/app/assets/javascripts/notes/components/issue_notes_app.vue
index 22653e561c3..d84976ad173 100644
--- a/app/assets/javascripts/notes/components/issue_notes_app.vue
+++ b/app/assets/javascripts/notes/components/issue_notes_app.vue
@@ -110,8 +110,8 @@
}, 15000);
},
bindEventHubListeners() {
- eventHub.$on('toggleAward', (data) => {
- const { awardName, noteId } = data;
+ this.$el.parentElement.addEventListener('toggleAward', (event) => {
+ const { awardName, noteId } = event.detail;
const endpoint = this.notesById[noteId].toggle_award_path;
this.actionToggleAward({ endpoint, awardName, noteId })