Commit b68b42c2 authored by Gautam Chitnis's avatar Gautam Chitnis

Alteration (playlist): Implemented bus message passing for component

This commit implements bus message passing technique to communicate to components.
In particular, this commit deals with open and close operations on playlist mobile view.

Gautam C.
parent 394a08b6
......@@ -30,7 +30,13 @@ Vue.component('playlist', {
},
created: function()
{
bus.$on('playlistClose', function()
{
console.log("bus event");
this.closePlaylist();
}.bind(this));
this.refreshPlaylist();
}
});
......@@ -38,6 +44,6 @@ $(document).click(function(e){
var container = $("#playlistNav");
if($(window).width() <= 480 && !container.is(e.target) && container.has(e.target).length === 0 && container.css("width") != "0px"){
app.$refs.plist.closePlaylist();
bus.$emit('playlistClose');
}
});
\ No newline at end of file
......@@ -4,9 +4,11 @@ var jsonData;
var xmlData;
var data;
var playlist;
var bus;
$(function() { // Handler for .ready() called.
plyrInit();
bus = new Vue();
vueInit();
});
......
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