Commit d1198bb2 authored by Arthur Verschaeve's avatar Arthur Verschaeve

Spine: compile using latest coffee

parent 5acb4b96
// Generated by CoffeeScript 1.7.1 // Generated by CoffeeScript 1.9.1
(function() { (function() {
var TodoApp, var TodoApp,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; hasProp = {}.hasOwnProperty;
TodoApp = (function(_super) { TodoApp = (function(superClass) {
var ENTER_KEY; var ENTER_KEY;
__extends(TodoApp, _super); extend(TodoApp, superClass);
ENTER_KEY = 13; ENTER_KEY = 13;
...@@ -30,10 +30,10 @@ ...@@ -30,10 +30,10 @@
}; };
function TodoApp() { function TodoApp() {
this.renderFooter = __bind(this.renderFooter, this); this.renderFooter = bind(this.renderFooter, this);
this.toggleElems = __bind(this.toggleElems, this); this.toggleElems = bind(this.toggleElems, this);
this.addAll = __bind(this.addAll, this); this.addAll = bind(this.addAll, this);
this.addNew = __bind(this.addNew, this); this.addNew = bind(this.addNew, this);
TodoApp.__super__.constructor.apply(this, arguments); TodoApp.__super__.constructor.apply(this, arguments);
Todo.bind('create', this.addNew); Todo.bind('create', this.addNew);
Todo.bind('refresh change', this.addAll); Todo.bind('refresh change', this.addAll);
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
this.filter = param.filter; this.filter = param.filter;
/* /*
TODO: Need to figure out why the route doesn't trigger `change` event TODO: Need to figure out why the route doesn't trigger `change` event
*/ */
Todo.trigger('refresh'); Todo.trigger('refresh');
return this.filters.removeClass('selected').filter("[href='#/" + this.filter + "']").addClass('selected'); return this.filters.removeClass('selected').filter("[href='#/" + this.filter + "']").addClass('selected');
...@@ -84,23 +84,23 @@ ...@@ -84,23 +84,23 @@
}; };
TodoApp.prototype.addAll = function() { TodoApp.prototype.addAll = function() {
var todo, _i, _len, _ref, _results; var i, len, ref, results, todo;
this.todos.empty(); this.todos.empty();
_ref = this.getByFilter(); ref = this.getByFilter();
_results = []; results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (i = 0, len = ref.length; i < len; i++) {
todo = _ref[_i]; todo = ref[i];
_results.push(this.addNew(todo)); results.push(this.addNew(todo));
} }
return _results; return results;
}; };
TodoApp.prototype.toggleAll = function(e) { TodoApp.prototype.toggleAll = function(e) {
return Todo.each(function(todo) { return Todo.each(function(todo) {
/* /*
TODO: Model updateAttribute sometimes won't stick: TODO: Model updateAttribute sometimes won't stick:
https://github.com/maccman/spine/issues/219 https://github.com/maccman/spine/issues/219
*/ */
todo.updateAttribute('completed', e.target.checked); todo.updateAttribute('completed', e.target.checked);
return todo.trigger('update', todo); return todo.trigger('update', todo);
......
// Generated by CoffeeScript 1.7.1 // Generated by CoffeeScript 1.9.1
(function() { (function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }, var bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty, extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; hasProp = {}.hasOwnProperty;
window.Todos = (function(_super) { window.Todos = (function(superClass) {
var ENTER_KEY, ESCAPE_KEY, TPL; var ENTER_KEY, ESCAPE_KEY, TPL;
__extends(Todos, _super); extend(Todos, superClass);
ENTER_KEY = 13; ENTER_KEY = 13;
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
}; };
function Todos() { function Todos() {
this.render = __bind(this.render, this); this.render = bind(this.render, this);
Todos.__super__.constructor.apply(this, arguments); Todos.__super__.constructor.apply(this, arguments);
this.todo.bind('update', this.render); this.todo.bind('update', this.render);
this.todo.bind('destroy', this.release); this.todo.bind('destroy', this.release);
......
// Generated by CoffeeScript 1.7.1 // Generated by CoffeeScript 1.9.1
(function() { (function() {
var __hasProp = {}.hasOwnProperty, var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }; hasProp = {}.hasOwnProperty;
window.Todo = (function(_super) { window.Todo = (function(superClass) {
__extends(Todo, _super); extend(Todo, superClass);
function Todo() { function Todo() {
return Todo.__super__.constructor.apply(this, arguments); return Todo.__super__.constructor.apply(this, arguments);
...@@ -27,14 +27,14 @@ ...@@ -27,14 +27,14 @@
}; };
Todo.destroyCompleted = function() { Todo.destroyCompleted = function() {
var todo, _i, _len, _ref, _results; var i, len, ref, results, todo;
_ref = this.completed(); ref = this.completed();
_results = []; results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) { for (i = 0, len = ref.length; i < len; i++) {
todo = _ref[_i]; todo = ref[i];
_results.push(todo.destroy()); results.push(todo.destroy());
} }
return _results; return results;
}; };
return Todo; return Todo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment