complete.js: Keep IE11 compatibility

This commit is contained in:
Johannes Meyer 2020-07-29 09:54:49 +02:00
parent 4019522da1
commit fcd0a0a698
1 changed files with 9 additions and 9 deletions
public/js/icinga/behavior

View File

@ -13,7 +13,7 @@
* @param icinga * @param icinga
* @constructor * @constructor
*/ */
let Complete = function (icinga) { var Complete = function (icinga) {
Icinga.EventListener.call(this, icinga); Icinga.EventListener.call(this, icinga);
this.on('beforerender', '.container', this.onBeforeRender, this); this.on('beforerender', '.container', this.onBeforeRender, this);
@ -55,8 +55,8 @@
let inputs = event.currentTarget.querySelectorAll('input[data-term-completion]'); let inputs = event.currentTarget.querySelectorAll('input[data-term-completion]');
// Remember current instances // Remember current instances
inputs.forEach((input) => { inputs.forEach(function (input) {
let enrichment = _this._enrichments.get(input); var enrichment = _this._enrichments.get(input);
if (enrichment) { if (enrichment) {
_this._cachedEnrichments[_this.icinga.utils.getDomPath(input).join(' ')] = enrichment; _this._cachedEnrichments[_this.icinga.utils.getDomPath(input).join(' ')] = enrichment;
} }
@ -74,9 +74,9 @@
if (autorefresh) { if (autorefresh) {
// Apply remembered instances // Apply remembered instances
for (let inputPath in _this._cachedEnrichments) { for (var inputPath in _this._cachedEnrichments) {
let enrichment = _this._cachedEnrichments[inputPath]; var enrichment = _this._cachedEnrichments[inputPath];
let input = container.querySelector(inputPath); var input = container.querySelector(inputPath);
if (input !== null) { if (input !== null) {
enrichment.refresh(input); enrichment.refresh(input);
_this._enrichments.set(input, enrichment); _this._enrichments.set(input, enrichment);
@ -89,9 +89,9 @@
} }
// Create new instances // Create new instances
let inputs = container.querySelectorAll('input[data-term-completion]'); var inputs = container.querySelectorAll('input[data-term-completion]');
inputs.forEach((input) => { inputs.forEach(function (input) {
let enrichment = _this._enrichments.get(input); var enrichment = _this._enrichments.get(input);
if (! enrichment) { if (! enrichment) {
enrichment = (new FilterInput(input)).bind(); enrichment = (new FilterInput(input)).bind();
enrichment.restoreTerms(); enrichment.restoreTerms();