Commit a373c821 authored by Sindre Sorhus's avatar Sindre Sorhus

Backbone app: Fix app trying to update cleared model

parent 43cda3d5
......@@ -56,11 +56,12 @@ $(function() {
close: function() {
var value = this.input.val().trim();
if ( !value ) {
if ( value ) {
this.model.save({ title: value });
} else {
this.clear();
}
this.model.save({ title: value });
$( this.el ).removeClass('editing');
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment