Commit 09734912 authored by addyosmani's avatar addyosmani

Adding ENTER_KEY const

parent a3d93c06
// Constants
var ENTER_KEY = 13;
// Setup namespace for the app // Setup namespace for the app
window.app = window.app || {}; window.app = window.app || {};
\ No newline at end of file
...@@ -108,7 +108,7 @@ $(function( $ ) { ...@@ -108,7 +108,7 @@ $(function( $ ) {
// persisting it to *localStorage*. // persisting it to *localStorage*.
createOnEnter: function(e) { createOnEnter: function(e) {
if ( e.keyCode !== 13 ){ if ( e.keyCode !== ENTER_KEY ){
return; return;
} }
......
...@@ -65,7 +65,7 @@ $(function() { ...@@ -65,7 +65,7 @@ $(function() {
// If you hit `enter`, we're through editing the item. // If you hit `enter`, we're through editing the item.
updateOnEnter: function(e) { updateOnEnter: function(e) {
if ( e.keyCode === 13 ){ if ( e.keyCode === ENTER_KEY ){
this.close(); this.close();
} }
}, },
......
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