Browse Source

widget.js : désactivation autocomplete sur filtre avec class 'autocomplete-disabled' #422

develop
Guillaume Bourgeois 2 years ago
parent
commit
92d278b228
1 changed files with 12 additions and 10 deletions
  1. +12
    -10
      Resources/assets/functions/widgets.js

+ 12
- 10
Resources/assets/functions/widgets.js View File

@@ -100,16 +100,18 @@ export class SovWidgets {
static setAutoCompleteField() {
var autocompleteFields = $('[data-lc-autocomplete-url]');
autocompleteFields.each(function () {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
//bootstrapVersion: 4,
//noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
if(!$(this).hasClass('autocomplete-disabled')) {
var $this = $(this),
url = $this.data('lc-autocomplete-url');

$this.autoComplete({
//bootstrapVersion: 4,
//noResultsText: 'Aucun résultat n\'a été trouvé.',
resolverSettings: {
url: url
}
});
}
});
}


Loading…
Cancel
Save