2012-07-17 22:22:38 +00:00
|
|
|
|
// js/modules/controls.js
|
|
|
|
|
// Module reference argument, assigned at the bottom
|
|
|
|
|
|
|
|
|
|
(function (Switch) {
|
2012-07-19 21:45:22 +00:00
|
|
|
|
// Dependencies
|
|
|
|
|
var Util = app.module('util'),
|
|
|
|
|
Option = app.module('option');
|
|
|
|
|
|
2012-07-19 14:25:01 +00:00
|
|
|
|
Switch.Model = Backbone.Model.extend({
|
|
|
|
|
defaults: {
|
2012-07-19 21:45:22 +00:00
|
|
|
|
status: 'off',
|
|
|
|
|
options: Option.List
|
2012-07-19 14:25:01 +00:00
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-17 22:22:38 +00:00
|
|
|
|
|
2012-07-19 14:25:01 +00:00
|
|
|
|
Switch.View = Backbone.View.extend({
|
2012-07-19 21:45:22 +00:00
|
|
|
|
initialize: function() {
|
|
|
|
|
console.log("Switch was initialized");
|
|
|
|
|
//this.template = Handlebars.compile(Util.getTemplate('switch'));
|
|
|
|
|
//console.log(this.model.get('options'));
|
|
|
|
|
},
|
2012-07-19 14:25:01 +00:00
|
|
|
|
render: function () {
|
2012-07-19 21:45:22 +00:00
|
|
|
|
//this.$el.html(this.template(this.model.toJSON()));
|
|
|
|
|
console.log("Switch rendering");
|
2012-07-19 14:25:01 +00:00
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
});
|
2012-07-17 22:22:38 +00:00
|
|
|
|
})(app.module("switch"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|