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
d9abbdbd
Commit
d9abbdbd
authored
Nov 25, 2015
by
Dave Methvin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shorten comments for jscs satisfaction
parent
03fb6318
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
examples/knockoutjs_require/js/viewmodels/todo.js
examples/knockoutjs_require/js/viewmodels/todo.js
+3
-2
No files found.
examples/knockoutjs_require/js/viewmodels/todo.js
View file @
d9abbdbd
...
@@ -55,7 +55,7 @@ define([
...
@@ -55,7 +55,7 @@ define([
var
trimmedTitle
=
title
.
trim
();
var
trimmedTitle
=
title
.
trim
();
// Observable value changes are not triggered if they're consisting of whitespaces only
// Observable value changes are not triggered if they're consisting of whitespaces only
// Therefore
we've to compare untrimmed version with a trimmed one to chech
whether anything changed
// Therefore
, compare untrimmed version with a trimmed one to check
whether anything changed
// And if yes, we've to set the new value manually
// And if yes, we've to set the new value manually
if
(
title
!==
trimmedTitle
)
{
if
(
title
!==
trimmedTitle
)
{
item
.
title
(
trimmedTitle
);
item
.
title
(
trimmedTitle
);
...
@@ -106,7 +106,8 @@ define([
...
@@ -106,7 +106,8 @@ define([
// internal computed observable that fires whenever anything changes in our todos
// internal computed observable that fires whenever anything changes in our todos
ko
.
computed
(
function
()
{
ko
.
computed
(
function
()
{
// store a clean copy to local storage, which also creates a dependency on the observableArray and all observables in each item
// store a clean copy to local storage, which also creates a dependency
// on the observableArray and all observables in each item
window
.
localStorage
.
setItem
(
g
.
localStorageItem
,
ko
.
toJSON
(
self
.
todos
));
window
.
localStorage
.
setItem
(
g
.
localStorageItem
,
ko
.
toJSON
(
self
.
todos
));
}).
extend
({
}).
extend
({
rateLimit
:
{
timeout
:
500
,
method
:
'
notifyWhenChangesStop
'
}
rateLimit
:
{
timeout
:
500
,
method
:
'
notifyWhenChangesStop
'
}
...
...
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