mirror of
https://github.com/2ec0b4/kaamelott-soundboard.git
synced 2025-12-08 23:53:24 +00:00
32 lines
725 B
JavaScript
32 lines
725 B
JavaScript
define(
|
|
'views/sound',
|
|
[
|
|
'marionette',
|
|
'models/sound',
|
|
'hbs!templates/sound'
|
|
],
|
|
function (Marionette, SoundModel, SoundBlockTemplate) {
|
|
"use strict";
|
|
|
|
var SoundBlockView = Marionette.ItemView.extend({
|
|
template: SoundBlockTemplate,
|
|
model: SoundModel,
|
|
tagName: 'li',
|
|
ui: {
|
|
soundItem: 'a'
|
|
},
|
|
events: {
|
|
'click @ui.soundItem': 'playSound'
|
|
},
|
|
playSound: function(e) {
|
|
e.preventDefault();
|
|
|
|
this.trigger('sound:play');
|
|
|
|
this.model.play();
|
|
}
|
|
});
|
|
|
|
return SoundBlockView;
|
|
});
|