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
0f75cb53
Commit
0f75cb53
authored
May 31, 2013
by
Addy Osmani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes #305 - bringing lower case consistency to app.Todos
parent
834b79f6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
17 deletions
+17
-17
architecture-examples/backbone/js/collections/todos.js
architecture-examples/backbone/js/collections/todos.js
+1
-1
architecture-examples/backbone/js/routers/router.js
architecture-examples/backbone/js/routers/router.js
+1
-1
architecture-examples/backbone/js/views/app.js
architecture-examples/backbone/js/views/app.js
+15
-15
No files found.
architecture-examples/backbone/js/collections/todos.js
View file @
0f75cb53
...
...
@@ -44,5 +44,5 @@ var app = app || {};
});
// Create our global collection of **Todos**.
app
.
T
odos
=
new
TodoList
();
app
.
t
odos
=
new
TodoList
();
})();
architecture-examples/backbone/js/routers/router.js
View file @
0f75cb53
...
...
@@ -17,7 +17,7 @@ var app = app || {};
// Trigger a collection filter event, causing hiding/unhiding
// of Todo view items
app
.
T
odos
.
trigger
(
'
filter
'
);
app
.
t
odos
.
trigger
(
'
filter
'
);
}
});
...
...
architecture-examples/backbone/js/views/app.js
View file @
0f75cb53
...
...
@@ -33,22 +33,22 @@ var app = app || {};
this
.
$footer
=
this
.
$
(
'
#footer
'
);
this
.
$main
=
this
.
$
(
'
#main
'
);
this
.
listenTo
(
app
.
T
odos
,
'
add
'
,
this
.
addOne
);
this
.
listenTo
(
app
.
T
odos
,
'
reset
'
,
this
.
addAll
);
this
.
listenTo
(
app
.
T
odos
,
'
change:completed
'
,
this
.
filterOne
);
this
.
listenTo
(
app
.
T
odos
,
'
filter
'
,
this
.
filterAll
);
this
.
listenTo
(
app
.
T
odos
,
'
all
'
,
this
.
render
);
this
.
listenTo
(
app
.
t
odos
,
'
add
'
,
this
.
addOne
);
this
.
listenTo
(
app
.
t
odos
,
'
reset
'
,
this
.
addAll
);
this
.
listenTo
(
app
.
t
odos
,
'
change:completed
'
,
this
.
filterOne
);
this
.
listenTo
(
app
.
t
odos
,
'
filter
'
,
this
.
filterAll
);
this
.
listenTo
(
app
.
t
odos
,
'
all
'
,
this
.
render
);
app
.
T
odos
.
fetch
();
app
.
t
odos
.
fetch
();
},
// Re-rendering the App just means refreshing the statistics -- the rest
// of the app doesn't change.
render
:
function
()
{
var
completed
=
app
.
T
odos
.
completed
().
length
;
var
remaining
=
app
.
T
odos
.
remaining
().
length
;
var
completed
=
app
.
t
odos
.
completed
().
length
;
var
remaining
=
app
.
t
odos
.
remaining
().
length
;
if
(
app
.
T
odos
.
length
)
{
if
(
app
.
t
odos
.
length
)
{
this
.
$main
.
show
();
this
.
$footer
.
show
();
...
...
@@ -79,7 +79,7 @@ var app = app || {};
// Add all items in the **Todos** collection at once.
addAll
:
function
()
{
this
.
$
(
'
#todo-list
'
).
html
(
''
);
app
.
T
odos
.
each
(
this
.
addOne
,
this
);
app
.
t
odos
.
each
(
this
.
addOne
,
this
);
},
filterOne
:
function
(
todo
)
{
...
...
@@ -87,14 +87,14 @@ var app = app || {};
},
filterAll
:
function
()
{
app
.
T
odos
.
each
(
this
.
filterOne
,
this
);
app
.
t
odos
.
each
(
this
.
filterOne
,
this
);
},
// Generate the attributes for a new Todo item.
newAttributes
:
function
()
{
return
{
title
:
this
.
$input
.
val
().
trim
(),
order
:
app
.
T
odos
.
nextOrder
(),
order
:
app
.
t
odos
.
nextOrder
(),
completed
:
false
};
},
...
...
@@ -106,20 +106,20 @@ var app = app || {};
return
;
}
app
.
T
odos
.
create
(
this
.
newAttributes
());
app
.
t
odos
.
create
(
this
.
newAttributes
());
this
.
$input
.
val
(
''
);
},
// Clear all completed todo items, destroying their models.
clearCompleted
:
function
()
{
_
.
invoke
(
app
.
T
odos
.
completed
(),
'
destroy
'
);
_
.
invoke
(
app
.
t
odos
.
completed
(),
'
destroy
'
);
return
false
;
},
toggleAllComplete
:
function
()
{
var
completed
=
this
.
allCheckbox
.
checked
;
app
.
T
odos
.
each
(
function
(
todo
)
{
app
.
t
odos
.
each
(
function
(
todo
)
{
todo
.
save
({
'
completed
'
:
completed
});
...
...
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