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
2efa9037
Commit
2efa9037
authored
Aug 05, 2013
by
Addy Osmani
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #649 from passy/backbone-trimming
Backbone: trim edits
parents
f7db3237
edde2237
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
architecture-examples/backbone/js/views/todos.js
architecture-examples/backbone/js/views/todos.js
+4
-3
No files found.
architecture-examples/backbone/js/views/todos.js
View file @
2efa9037
...
...
@@ -67,10 +67,11 @@ var app = app || {};
// Close the `"editing"` mode, saving changes to the todo.
close
:
function
()
{
var
value
=
this
.
$input
.
val
().
trim
();
var
trimmedValue
=
this
.
$input
.
val
().
trim
();
this
.
$input
.
val
(
trimmedValue
);
if
(
v
alue
)
{
this
.
model
.
save
({
title
:
v
alue
});
if
(
trimmedV
alue
)
{
this
.
model
.
save
({
title
:
trimmedV
alue
});
}
else
{
this
.
clear
();
}
...
...
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