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

Fait en sorte de ne jouer le son qu'une seule fois au chargement (#15)

This commit is contained in:
Antoine
2016-12-01 23:05:18 +01:00
committed by GitHub
parent 4c18df3c1a
commit 41816fce5a
3 changed files with 6 additions and 2 deletions

View File

@@ -43,6 +43,8 @@ define("views/sound", function(require) {
if( !/iPhone|iPad|iPod/i.test(navigator.userAgent) ) {
this.$el.find(this.ui.btnPlay).click();
}
this.model.set('selected', false);
}
},
toggleSound: function(e) {

View File

@@ -32,11 +32,12 @@ define("views/sounds", function(require) {
onBeforeRender: function() {
var sound;
if( this.slug ) {
if( !!this.slug ) {
sound = this.collection.findWhere({file: this.slug+".mp3"});
if( sound ) {
sound.set('selected', true);
this.slug = "";
}
}
},