Commit 9acf763f authored by Petar Petrovic's avatar Petar Petrovic Committed by Pascal Hartig

Renamed indexFromEl function to getIndexFromEl (#1746)

All other functions on the App object are in verb form. This change
ensures all methods have consistent naming form.
parent ae2dd195
......@@ -121,7 +121,7 @@ jQuery(function ($) {
},
// accepts an element from inside the `.item` div and
// returns the corresponding index in the `todos` array
indexFromEl: function (el) {
getIndexFromEl: function (el) {
var id = $(el).closest('li').data('id');
var todos = this.todos;
var i = todos.length;
......@@ -151,7 +151,7 @@ jQuery(function ($) {
this.render();
},
toggle: function (e) {
var i = this.indexFromEl(e.target);
var i = this.getIndexFromEl(e.target);
this.todos[i].completed = !this.todos[i].completed;
this.render();
},
......@@ -181,13 +181,13 @@ jQuery(function ($) {
if ($el.data('abort')) {
$el.data('abort', false);
} else {
this.todos[this.indexFromEl(el)].title = val;
this.todos[this.getIndexFromEl(el)].title = val;
}
this.render();
},
destroy: function (e) {
this.todos.splice(this.indexFromEl(e.target), 1);
this.todos.splice(this.getIndexFromEl(e.target), 1);
this.render();
}
};
......
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