Browse Source

Fixed bug where the youtube video wouldn't stop, even if EditSong Modal was closed

theflametrooper 8 years ago
parent
commit
fa0124497a

+ 5 - 0
frontend/components/Admin/QueueSongs.vue

@@ -64,6 +64,11 @@
 				return this.$eval('songs | filterBy searchQuery');
 			}
 		},
+		watch: {
+			'modals.editSong': function (value) {
+				if (!value) this.$broadcast('stopVideo');
+			}
+		},
 		methods: {
 			toggleModal: function () {
 				this.modals.editSong = !this.modals.editSong;

+ 5 - 0
frontend/components/Admin/Songs.vue

@@ -68,6 +68,11 @@
 				return this.$eval('songs | filterBy searchQuery');
 			}
 		},
+		watch: {
+			'modals.editSong': function (value) {
+				if (!value) this.$broadcast('stopVideo');
+			}
+		},
 		methods: {
 			toggleModal: function () {
 				this.modals.editSong = !this.modals.editSong;

+ 4 - 0
frontend/components/Modals/EditSong.vue

@@ -265,6 +265,7 @@
 		events: {
 			closeModal: function () {
 				this.$parent.modals.editSong = false;
+				this.video.player.stopVideo();
 			},
 			editSong: function (song, index, type) {
 				let _this = this;
@@ -282,6 +283,9 @@
 					if (res.status === 'success') _this.reports = res.data;
 				});
 				this.$parent.toggleModal();
+			},
+			stopVideo: function () {
+				this.video.player.stopVideo();
 			}
 		}
 	}