Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
slusarz committed Dec 6, 2014
1 parent 0a66282 commit da48260
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions imp/js/autocomplete.js
Expand Up @@ -208,11 +208,7 @@ var IMP_Autocompleter = Class.create({

getEntryByElt: function(elt)
{
var itemid = elt.retrieve('itemid');

return this.data.detect(function(v) {
return (v.id == itemid);
});
return this.getEntryById(elt.retrieve('itemid'));
},

getEntryById: function(id)
Expand Down Expand Up @@ -276,7 +272,7 @@ var IMP_Autocompleter = Class.create({
{
if (Object.isElement(input)) {
this.input.setValue(
this.getEntryById(input.retrieve('itemid')).value
this.getEntryByElt(input).value
);
this.removeEntry(input);
} else {
Expand Down

0 comments on commit da48260

Please sign in to comment.