Restore code for showing asyc the autocomplete.
This commit is contained in:
parent
4036f5cd28
commit
f71aa6c5b9
|
@ -1115,20 +1115,23 @@ treemode._onKeyDown = function (event) {
|
||||||
(this.options.autocomplete.applyTo.indexOf('field') >= 0 && jsonElementType == "field")) {
|
(this.options.autocomplete.applyTo.indexOf('field') >= 0 && jsonElementType == "field")) {
|
||||||
var node = Node.getNodeFromTarget(event.target);
|
var node = Node.getNodeFromTarget(event.target);
|
||||||
// Activate autocomplete
|
// Activate autocomplete
|
||||||
if (event.target.innerText.length > 0) {
|
setTimeout(function (hnode, element) {
|
||||||
var result = this.options.autocomplete.getOptions(this.autocomplete, node, event.target.innerText, jsonElementType);
|
if (element.innerText.length > 0) {
|
||||||
if (typeof result.then === 'function') {
|
var result = this.options.autocomplete.getOptions(this.autocomplete, hnode, element.innerText, jsonElementType);
|
||||||
// probably a promise
|
if (typeof result.then === 'function') {
|
||||||
if (result.then(function (options) {
|
// probably a promise
|
||||||
this.autocomplete.show(event.target, options);
|
if (result.then(function (options) {
|
||||||
}.bind(this)));
|
this.autocomplete.show(element, options);
|
||||||
} else {
|
}.bind(this)));
|
||||||
// definitely not a promise
|
} else {
|
||||||
this.autocomplete.show(event.target, result);
|
// definitely not a promise
|
||||||
|
this.autocomplete.show(element, result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
this.autocomplete.hideDropDown();
|
||||||
this.autocomplete.hideDropDown();
|
|
||||||
|
}.bind(this, node, event.target), 50);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue