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
Sven Franck
todomvc
Commits
d95b22b7
Commit
d95b22b7
authored
Dec 15, 2011
by
Fred Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Blank entries should not be added
parent
488ddc31
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
0 deletions
+7
-0
todo-example/spine/js/models/task.js
todo-example/spine/js/models/task.js
+4
-0
todo-example/spine/src/models/task.coffee
todo-example/spine/src/models/task.coffee
+3
-0
No files found.
todo-example/spine/js/models/task.js
View file @
d95b22b7
...
...
@@ -13,6 +13,10 @@
Task
.
extend
(
Spine
.
Model
.
Local
);
Task
.
prototype
.
validate
=
function
()
{
if
(
!
$
.
trim
(
this
.
name
))
return
'
Task name is required
'
;
};
Task
.
active
=
function
()
{
return
this
.
select
(
function
(
task
)
{
return
!
task
.
done
;
...
...
todo-example/spine/src/models/task.coffee
View file @
d95b22b7
...
...
@@ -2,6 +2,9 @@ class window.Task extends Spine.Model
@
configure
'Task'
,
'name'
,
'done'
@
extend
Spine
.
Model
.
Local
validate
:
->
'Task name is required'
unless
$
.
trim
(
@
name
)
@
active
:
->
@
select
(
task
)
->
!
task
.
done
...
...
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