Commit ae39b8e5 authored by Nate Oliver's avatar Nate Oliver Committed by Pascal Hartig

Renamed edit function to editingMode (#1747)

The edit function actually switches the todo to an editable input, it doesn't edit anything itself. The new function name 'editingMode' is more accurate and descriptive.
parent 9acf763f
...@@ -58,7 +58,7 @@ jQuery(function ($) { ...@@ -58,7 +58,7 @@ jQuery(function ($) {
$('#footer').on('click', '#clear-completed', this.destroyCompleted.bind(this)); $('#footer').on('click', '#clear-completed', this.destroyCompleted.bind(this));
$('#todo-list') $('#todo-list')
.on('change', '.toggle', this.toggle.bind(this)) .on('change', '.toggle', this.toggle.bind(this))
.on('dblclick', 'label', this.edit.bind(this)) .on('dblclick', 'label', this.editingMode.bind(this))
.on('keyup', '.edit', this.editKeyup.bind(this)) .on('keyup', '.edit', this.editKeyup.bind(this))
.on('focusout', '.edit', this.update.bind(this)) .on('focusout', '.edit', this.update.bind(this))
.on('click', '.destroy', this.destroy.bind(this)); .on('click', '.destroy', this.destroy.bind(this));
...@@ -155,7 +155,7 @@ jQuery(function ($) { ...@@ -155,7 +155,7 @@ jQuery(function ($) {
this.todos[i].completed = !this.todos[i].completed; this.todos[i].completed = !this.todos[i].completed;
this.render(); this.render();
}, },
edit: function (e) { editingMode: function (e) {
var $input = $(e.target).closest('li').addClass('editing').find('.edit'); var $input = $(e.target).closest('li').addClass('editing').find('.edit');
$input.val($input.val()).focus(); $input.val($input.val()).focus();
}, },
......
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