/server/draw.js
JavaScript | 31 lines | 23 code | 7 blank | 1 comment | 0 complexity | 27ae0e6144be46245e3e0224396450e9 MD5 | raw file
Possible License(s): Apache-2.0, BSD-3-Clause, MIT
- // Users
- exports.init = function(d) {
- var _ = d._
- , Backbone = d.Backbone;
- var LineModel = Backbone.Model.extend();
- var LineCollection = Backbone.Collection.extend({
- model: LineModel
- });
- return DrawController = Backbone.Controller.extend({
- initialize: function () {
- var t = this;
- var lineCollection = this.lineCollection = new LineCollection();
- lineCollection.on('add', function (user) {
- t.trigger('_lineAdded', line.toJSON() );
- });
- },
- render: function () {
- return this.lineCollection.toJSON();
- },
- add: function (line) {
- this.lineCollection.add(line);
- }
- });
- };