bunti-node/js/modules/devices/switch.js

32 lines
784 B
JavaScript
Raw Permalink Normal View History

// 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');
Switch.Model = Backbone.Model.extend({
defaults: {
2012-07-19 21:45:22 +00:00
status: 'off',
options: Option.List
}
});
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'));
},
render: function () {
2012-07-19 21:45:22 +00:00
//this.$el.html(this.template(this.model.toJSON()));
console.log("Switch rendering");
return this;
}
});
})(app.module("switch"));