Merge branch 'main' into refactor/sk-12-21

This commit is contained in:
amazuecos
2025-02-09 13:24:55 +01:00
7 changed files with 218 additions and 65 deletions

View File

@ -4,11 +4,12 @@
* @param {String} url
* @param {String} placeholder
*/
let ClassSelect = function (domItem, url, placeholder, allowClear = false, params = {}, dropdownParent = "") {
let ClassSelect = function (domItem, url, placeholder, allowClear = false, params = {}, dropdownParent = "", hideSearch = false) {
this.url = url;
this.item = domItem;
this.params = params;
this.dropdownParent = dropdownParent;
this.hideSearch = hideSearch;
this.config = {
placeholder: placeholder,
@ -48,6 +49,11 @@ let ClassSelect = function (domItem, url, placeholder, allowClear = false, param
};
this.init = function () {
if (this.item.length) {
if(this.hideSearch){
this.config.minimumResultsForSearch = -1;
}
this.item = this.item.select2(this.config);
// $.fn.modal.Constructor.prototype.enforceFocus = function () {};
}