Merge pull request #4848 from ulferts/housekeep/replace_prototype_in_autocompleter

replace prototype in autocompleter
pull/4852/head
Oliver Günther 8 years ago committed by GitHub
commit 3f44c66dfa
  1. 6
      app/assets/javascripts/autocompleter.js

@ -108,7 +108,7 @@
setInputValue: function () {
var values = [];
if (hasAttribute(this.fakeInput, "data-selected")) {
JSON.parse(this.fakeInput.attr('data-selected')).forEach(function (elem) {
_.each(JSON.parse(this.fakeInput.attr('data-selected')), function (elem) {
values.push(elem[1]);
});
@ -153,7 +153,7 @@
},
results: function (data, page) {
var active_items = [];
data.results.items.each(function (e) {
_.each(data.results.items, function (e) {
active_items.push(e);
});
active_items = this.add_null_element(active_items, page);
@ -194,7 +194,7 @@
if (hasAttribute(element, "data-selected")) {
multiple = element.data("autocompleter").opts.multiple;
JSON.parse(element.attr('data-selected')).each(function (elem) {
_.each(JSON.parse(element.attr('data-selected')), function (elem) {
if (multiple) {
data.push({id: elem[1], name: elem[0]});
} else {

Loading…
Cancel
Save