mirror of
https://github.com/2ec0b4/kaamelott-soundboard.git
synced 2025-12-08 15:43:24 +00:00
Stoppe la lecture en cours
This commit is contained in:
@@ -15,7 +15,9 @@ define(
|
||||
play: function() {
|
||||
var audio = new Audio('sounds/'+this.attributes.file);
|
||||
|
||||
return audio.play();
|
||||
audio.play();
|
||||
|
||||
return audio;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ define(
|
||||
"use strict";
|
||||
|
||||
var SoundListView = Marionette.LayoutView.extend({
|
||||
collection : new SoundsCollection(),
|
||||
collection: new SoundsCollection(),
|
||||
template: SoundListTemplate,
|
||||
ui: {
|
||||
soundItem: 'li a'
|
||||
@@ -39,8 +39,15 @@ define(
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
this.stopCurrentPlay();
|
||||
|
||||
if( sound ) {
|
||||
sound.play();
|
||||
this.currentPlay = sound.play();
|
||||
}
|
||||
},
|
||||
stopCurrentPlay: function() {
|
||||
if( this.currentPlay && !this.currentPlay.paused ) {
|
||||
this.currentPlay.pause();
|
||||
}
|
||||
},
|
||||
serializeData: function () {
|
||||
|
||||
Reference in New Issue
Block a user