Commit 285035cc authored by addyosmani's avatar addyosmani

Brace, !== fixes.

parent dfa02a7c
......@@ -27,7 +27,9 @@
// We keep the Todos in sequential order, despite being saved by unordered
// GUID in the database. This generates the next order number for new items.
nextOrder: function() {
if (!this.length) return 1;
if ( !this.length ){
return 1;
}
return this.last().get('order') + 1;
},
......
......@@ -107,8 +107,14 @@ $(function( $ ) {
// If you hit return in the main input field, create new **Todo** model,
// persisting it to *localStorage*.
createOnEnter: function(e) {
if (e.keyCode != 13) return;
if (!this.input.val().trim()) return;
if ( e.keyCode !== 13 ){
return;
}
if ( !this.input.val().trim() ){
return;
}
window.app.Todos.create(this.newAttributes());
this.input.val('');
......
......@@ -55,7 +55,7 @@ $(function() {
close: function() {
var value = this.input.val().trim();
if (!value){
if ( !value ){
this.clear();
}
......@@ -65,7 +65,9 @@ $(function() {
// If you hit `enter`, we're through editing the item.
updateOnEnter: function(e) {
if (e.keyCode == 13) this.close();
if ( e.keyCode === 13 ){
this.close();
}
},
// Remove the item, destroy the model.
......
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