2012-07-17 22:22:38 +00:00
|
|
|
|
// js/modules/controls.js
|
|
|
|
|
// Module reference argument, assigned at the bottom
|
|
|
|
|
|
|
|
|
|
(function (Switch) {
|
2012-07-19 14:25:01 +00:00
|
|
|
|
Switch.Model = Backbone.Model.extend({
|
|
|
|
|
defaults: {
|
|
|
|
|
status: 'off'
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-17 22:22:38 +00:00
|
|
|
|
|
2012-07-19 14:25:01 +00:00
|
|
|
|
Switch.List = Backbone.Collection.extend({
|
|
|
|
|
model: Switch.Model
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
Switch.View = Backbone.View.extend({
|
|
|
|
|
render: function () {
|
|
|
|
|
this.template = Handlebars.compile(Util.getTemplate('switch'));
|
|
|
|
|
this.$el.html(this.template(this.model.toJSON()));
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-17 22:22:38 +00:00
|
|
|
|
})(app.module("switch"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|