Commit 7a98970b authored by Filipa Lacerda's avatar Filipa Lacerda

[ci skip] Removes Vue from awards handler code

parent 335d4a53
......@@ -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);
......
......@@ -170,7 +170,6 @@ import GpgBadges from './gpg_badges';
shortcut_handler = new ShortcutsIssuable();
new ZenMode();
initIssuableSidebar();
initNotes();
break;
case 'dashboard:milestones:index':
new ProjectSelect();
......
......@@ -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 })
......
......@@ -3,7 +3,7 @@
= link_to 'Reopen issue', issue_path(@issue, issue: {state_event: :reopen}, format: 'json'), data: {original_text: "Reopen issue", alternative_text: "Comment & reopen issue"}, class: "btn btn-nr btn-reopen btn-comment js-note-target-reopen #{issue_button_visibility(@issue, false)}", title: 'Reopen issue'
= link_to 'Close issue', issue_path(@issue, issue: {state_event: :close}, format: 'json'), data: {original_text: "Close issue", alternative_text: "Comment & close issue"}, class: "btn btn-nr btn-close btn-comment js-note-target-close #{issue_button_visibility(@issue, true)}", title: 'Close issue'
%section
%section.js-vue-notes-event
#js-vue-notes{ data: { discussions_path: discussions_namespace_project_issue_path(@project.namespace, @project, @issue, format: :json),
register_path: "#{new_session_path(:user, redirect_to_referer: 'yes')}#register-pane",
new_session_path: new_session_path(:user, redirect_to_referer: 'yes'),
......
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