mirror of
https://github.com/2ec0b4/kaamelott-soundboard.git
synced 2025-12-08 15:43:24 +00:00
Modifie l'adresse réticulaire avec le son joué (#11)
This commit is contained in:
@@ -18,6 +18,7 @@ define("app", function(require) {
|
||||
|
||||
Radio.channel("App").reply("region:show", this.showRegion.bind(this));
|
||||
Radio.channel("App").reply("modal:show", this.showModal.bind(this));
|
||||
Radio.channel("Sounds").on("sound:play", this.changeUrl.bind(this));
|
||||
|
||||
this.router = new Marionette.AppRouter();
|
||||
|
||||
@@ -40,6 +41,10 @@ define("app", function(require) {
|
||||
likely.initiate();
|
||||
},
|
||||
|
||||
changeUrl: function(slug) {
|
||||
this.router.navigate("son/"+slug);
|
||||
},
|
||||
|
||||
showRegion: function showRegion(params) {
|
||||
this.mainRegion.show(params.view);
|
||||
},
|
||||
|
||||
@@ -13,7 +13,7 @@ define("views/sounds", function(require) {
|
||||
collection: new SoundsCollection(),
|
||||
tagName: "ul",
|
||||
childEvents: {
|
||||
"sound:play": "stopPlayingSound",
|
||||
"sound:play": "manageSounds",
|
||||
"sound:share": "shareSoundLink"
|
||||
},
|
||||
initialize: function(options) {
|
||||
@@ -51,6 +51,11 @@ define("views/sounds", function(require) {
|
||||
|
||||
this.render();
|
||||
},
|
||||
manageSounds: function(args) {
|
||||
this.stopPlayingSound();
|
||||
|
||||
Radio.channel("Sounds").trigger("sound:play", args.model.getSlug());
|
||||
},
|
||||
stopPlayingSound: function() {
|
||||
var playingSound = this.collection.findWhere({playing: true});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user