Browse Source

fix(SongItem): Clicking view YouTube video does not close actions tippy

Owen Diffey 2 years ago
parent
commit
cc8636efe1
1 changed files with 11 additions and 8 deletions
  1. 11 8
      frontend/src/components/SongItem.vue

+ 11 - 8
frontend/src/components/SongItem.vue

@@ -91,6 +91,16 @@ const hoverTippy = () => {
 	hoveredTippy.value = true;
 };
 
+const viewYoutubeVideo = youtubeId => {
+	hideTippyElements();
+	openModal({
+		modal: "viewYoutubeVideo",
+		props: {
+			youtubeId
+		}
+	});
+};
+
 const report = song => {
 	hideTippyElements();
 	openModal({ modal: "report", props: { song } });
@@ -201,14 +211,7 @@ onUnmounted(() => {
 						<div class="icons-group">
 							<i
 								v-if="disabledActions.indexOf('youtube') === -1"
-								@click="
-									openModal({
-										modal: 'viewYoutubeVideo',
-										props: {
-											youtubeId: song.youtubeId
-										}
-									})
-								"
+								@click="viewYoutubeVideo(song.youtubeId)"
 								content="View YouTube Video"
 								v-tippy
 							>