Commit 8253bfd4 authored by Sindre Sorhus's avatar Sindre Sorhus

Merge pull request #917 from dprotti/issue817

Fix for #817 batman sample does not trim text input
parents 40d5189a 5eb4dbbb
......@@ -24,7 +24,7 @@ class Alfred.TodosController extends Batman.Controller
class Alfred.TodosIndexView extends Batman.View
createTodo: (node, event, context) ->
event.preventDefault()
title = node[0].value
title = node[0].value.trim()
if title
newTodo = new Alfred.Todo(title: title, completed: false)
newTodo.save (err) ->
......
// Generated by CoffeeScript 1.6.3
// Generated by CoffeeScript 1.7.1
(function() {
var Alfred, _ref, _ref1, _ref2, _ref3,
var Alfred,
__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; };
......@@ -8,8 +8,7 @@
__extends(Alfred, _super);
function Alfred() {
_ref = Alfred.__super__.constructor.apply(this, arguments);
return _ref;
return Alfred.__super__.constructor.apply(this, arguments);
}
Alfred.root('todos#index', {
......@@ -62,14 +61,13 @@
__extends(TodosIndexView, _super);
function TodosIndexView() {
_ref1 = TodosIndexView.__super__.constructor.apply(this, arguments);
return _ref1;
return TodosIndexView.__super__.constructor.apply(this, arguments);
}
TodosIndexView.prototype.createTodo = function(node, event, context) {
var newTodo, title;
event.preventDefault();
title = node[0].value;
title = node[0].value.trim();
if (title) {
newTodo = new Alfred.Todo({
title: title,
......@@ -133,8 +131,7 @@
__extends(TodosActiveView, _super);
function TodosActiveView() {
_ref2 = TodosActiveView.__super__.constructor.apply(this, arguments);
return _ref2;
return TodosActiveView.__super__.constructor.apply(this, arguments);
}
return TodosActiveView;
......@@ -145,8 +142,7 @@
__extends(TodosCompletedView, _super);
function TodosCompletedView() {
_ref3 = TodosCompletedView.__super__.constructor.apply(this, arguments);
return _ref3;
return TodosCompletedView.__super__.constructor.apply(this, arguments);
}
return TodosCompletedView;
......
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