examples/todos/public/scripts/app.js
function todoBlurred(todo, event) {
    var trimmedText = event.target.value.trim();
    if (!trimmedText) {
      db.remove(todo);
    } else {
      todo.title = trimmedText;
      db.put(todo);
    }
  }
function todoBlurred(todo, event) {
    var trimmedText = event.target.value.trim();
    if (!trimmedText) {
      db.remove(todo);
    } else {
      todo.title = trimmedText;
      db.put(todo);
    }
  }
function todoBlurred ( todo , event ) { var trimmedText = event . target . value . trim ( ) ; if ( ! trimmedText ) { db . remove ( todo ) ; } else { todo . title = trimmedText ; db . put ( todo ) ; } }
The input box when editing a todo has blurred, we should save the new title or delete the todo if the title is empty
The input box when editing a todo has blurred we should save the new title or delete the todo if the title is empty