examples/todo/js/behaviors/todo.js
function(event, element, elementType) {

			if (elementType === 'edit-input') {
				var todoEl = getClosestTodoElement(element);

				if (event.keyCode === ENTER_KEY) {
					this.saveLabel(todoEl);
					this.hideEditor(todoEl);
				} else if (event.keyCode === ESCAPE_KEY) {
					this.hideEditor(todoEl);
				}

			}

		}
function(event, element, elementType) {

			if (elementType === 'edit-input') {
				var todoEl = getClosestTodoElement(element);

				if (event.keyCode === ENTER_KEY) {
					this.saveLabel(todoEl);
					this.hideEditor(todoEl);
				} else if (event.keyCode === ESCAPE_KEY) {
					this.hideEditor(todoEl);
				}

			}

		}
function ( event , element , elementType ) { if ( elementType === 'edit-input' ) { var todoEl = getClosestTodoElement ( element ) ; if ( event . keyCode === ENTER_KEY ) { this . saveLabel ( todoEl ) ; this . hideEditor ( todoEl ) ; } else if ( event . keyCode === ESCAPE_KEY ) { this . hideEditor ( todoEl ) ; } } }
Handles keydown events for the behavior.
@param {Event} event A DOM-normalized event object.
@param {HTMLElement} element The nearest HTML element with a data-type
attribute specified or null if there is none.
@param {string} elementType The value of data-type for the nearest
element with that attribute specified or null if there is none.
@returns {void}
Handles keydown events for the behavior .