Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
todomvc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eugene Shen
todomvc
Commits
5eb4dbbb
Commit
5eb4dbbb
authored
Jun 19, 2014
by
Duilio Protti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#817 Batman - trim title
parent
9017b22b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
14 deletions
+10
-14
labs/architecture-examples/batman/app.coffee
labs/architecture-examples/batman/app.coffee
+3
-3
labs/architecture-examples/batman/app.js
labs/architecture-examples/batman/app.js
+7
-11
No files found.
labs/architecture-examples/batman/app.coffee
View file @
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
)
->
...
...
@@ -79,8 +79,8 @@ class Alfred.Todo extends Batman.Model
@
encode
'title'
,
'completed'
@
validate
'title'
,
presence
:
true
@
classAccessor
'default'
,
->
@
get
(
'all'
).
filter
(
todo
)
->
true
@
classAccessor
'default'
,
->
@
get
(
'all'
).
filter
(
todo
)
->
true
@
classAccessor
'active'
,
->
@
get
(
'all'
).
filter
(
todo
)
->
!
todo
.
get
(
'completed'
)
...
...
labs/architecture-examples/batman/app.js
View file @
5eb4dbbb
// 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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment