1
0
mirror of https://github.com/2ec0b4/kaamelott-soundboard.git synced 2025-12-08 23:53:24 +00:00

Modifie l'adresse réticulaire avec le son joué (#11)

This commit is contained in:
Antoine
2016-11-30 22:50:42 +01:00
committed by GitHub
parent ca0c3673d6
commit 30104a6ad2
2 changed files with 11 additions and 1 deletions

View File

@@ -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});