1
0
mirror of https://github.com/2ec0b4/kaamelott-soundboard.git synced 2025-12-08 15:43:24 +00:00
This commit is contained in:
Thomas Graviou
2019-11-04 13:41:56 +01:00
parent aa163e62e1
commit e836219021
4 changed files with 58 additions and 6 deletions

View File

@@ -1,2 +1,2 @@
<button id="random">Son aléatoire</button>
<button id="reset">reset</button>
<button id="random" class="random">🎲</button>
<button id="reset" class="reset">❌</button>

View File

@@ -1,10 +1,12 @@
<div id="filter">
<span>
<div id="filter">
</div>
</div>
<div id="random">
<div id="random">
</div>
</div>
</span>
<div id="list">

View File

@@ -65,6 +65,8 @@ define("views/sounds", function(require) {
Radio.channel("Sounds").trigger("sound:play", args.model.getSlug());
},
randomSound: function() {
this.stopPlayingSound();
this.filterCollection("");
var index = Math.floor(Math.random() * Math.floor(this.collection.length));
var sound = this.collection.models[index];