1
0
mirror of https://github.com/2ec0b4/kaamelott-soundboard.git synced 2025-12-09 08:03:24 +00:00

Révise la récupération des données avec une Radio

This commit is contained in:
Antoine
2016-04-09 17:47:11 +02:00
parent 0c84cd6968
commit 2202364489
7 changed files with 80 additions and 9 deletions

25
js/app/radios/sounds.js Normal file
View File

@@ -0,0 +1,25 @@
define(
'radios/sounds',
[
'marionette',
'backbone.radio',
'collections/sounds'
],
function (Marionette, Radio, SoundsCollection) {
"use strict";
var SoundsRadio = Marionette.Object.extend({
initialize : function () {
this.channel = Radio.channel('Sounds');
this.channel.reply('getSounds', this.getSounds.bind(this));
},
getSounds: function() {
var soundsCollection = new SoundsCollection();
return soundsCollection.fetch();
}
});
return SoundsRadio;
});