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