1
0
mirror of https://github.com/2ec0b4/kaamelott-soundboard.git synced 2025-12-10 00:15:34 +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

@@ -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];