Commit 74c49b35 authored by Pascal Hartig's avatar Pascal Hartig

Spine: Recompiled with CoffeeScript 1.6.2

parent 0a865424
// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.6.2
(function() {
var TodoApp,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
......@@ -31,13 +31,9 @@
function TodoApp() {
this.renderFooter = __bind(this.renderFooter, this);
this.toggleElems = __bind(this.toggleElems, this);
this.addAll = __bind(this.addAll, this);
this.addNew = __bind(this.addNew, this);
TodoApp.__super__.constructor.apply(this, arguments);
this.addNew = __bind(this.addNew, this); TodoApp.__super__.constructor.apply(this, arguments);
Todo.bind('create', this.addNew);
Todo.bind('refresh change', this.addAll);
Todo.bind('refresh change', this.toggleElems);
......@@ -58,6 +54,7 @@
TodoApp.prototype["new"] = function(e) {
var val;
val = $.trim(this.newTodoInput.val());
if (e.which === ENTER_KEY && val) {
Todo.create({
......@@ -80,6 +77,7 @@
TodoApp.prototype.addNew = function(todo) {
var view;
view = new Todos({
todo: todo
});
......@@ -88,6 +86,7 @@
TodoApp.prototype.addAll = function() {
var todo, _i, _len, _ref, _results;
this.todos.empty();
_ref = this.getByFilter();
_results = [];
......@@ -115,6 +114,7 @@
TodoApp.prototype.toggleElems = function() {
var isTodos;
isTodos = !!Todo.count();
this.main.toggle(isTodos);
this.footer.toggle(isTodos);
......@@ -126,6 +126,7 @@
TodoApp.prototype.renderFooter = function() {
var active, completed, text;
text = function(count) {
if (count === 1) {
return 'item';
......
// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.6.2
(function() {
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
......@@ -26,8 +26,7 @@
};
function Todos() {
this.render = __bind(this.render, this);
Todos.__super__.constructor.apply(this, arguments);
this.render = __bind(this.render, this); Todos.__super__.constructor.apply(this, arguments);
this.todo.bind('update', this.render);
this.todo.bind('destroy', this.release);
}
......@@ -52,6 +51,7 @@
Todos.prototype.finishEdit = function() {
var val;
this.el.removeClass('editing');
val = $.trim(this.editElem.val());
if (val) {
......
// Generated by CoffeeScript 1.3.3
// Generated by CoffeeScript 1.6.2
(function() {
var __hasProp = {}.hasOwnProperty,
var _ref,
__hasProp = {}.hasOwnProperty,
__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; };
window.Todo = (function(_super) {
__extends(Todo, _super);
function Todo() {
return Todo.__super__.constructor.apply(this, arguments);
_ref = Todo.__super__.constructor.apply(this, arguments);
return _ref;
}
Todo.configure('Todo', 'title', 'completed');
......@@ -28,11 +29,12 @@
};
Todo.destroyCompleted = function() {
var todo, _i, _len, _ref, _results;
_ref = this.completed();
var todo, _i, _len, _ref1, _results;
_ref1 = this.completed();
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
todo = _ref[_i];
for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
todo = _ref1[_i];
_results.push(todo.destroy());
}
return _results;
......
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