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
2d8b292f
Commit
2d8b292f
authored
May 09, 2015
by
Sam Saccone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly update list according to filter state.
Fixes #1290
parent
aa118065
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
examples/backbone_marionette/js/TodoMVC.TodoList.Views.js
examples/backbone_marionette/js/TodoMVC.TodoList.Views.js
+3
-7
No files found.
examples/backbone_marionette/js/TodoMVC.TodoList.Views.js
View file @
2d8b292f
...
...
@@ -99,7 +99,8 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
},
collectionEvents
:
{
'
all
'
:
'
update
'
'
change:completed
'
:
'
render
'
,
all
:
'
setCheckAllState
'
},
initialize
:
function
()
{
...
...
@@ -111,17 +112,12 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
return
child
.
matchesFilter
(
filteredOn
);
},
onRender
:
function
()
{
this
.
update
();
},
update
:
function
()
{
setCheckAllState
:
function
()
{
function
reduceCompleted
(
left
,
right
)
{
return
left
&&
right
.
get
(
'
completed
'
);
}
var
allCompleted
=
this
.
collection
.
reduce
(
reduceCompleted
,
true
);
this
.
ui
.
toggle
.
prop
(
'
checked
'
,
allCompleted
);
this
.
$el
.
parent
().
toggle
(
!!
this
.
collection
.
length
);
},
...
...
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