Add beforeInitCallback humhub.ui.picker (#7437)

* Add beforeInitCallback `humhub.ui.picker`

* Add beforeInitCallback humhub.ui.picker
This commit is contained in:
Gevorg Mansuryan 2025-02-22 12:25:01 +04:00 committed by GitHub
parent e5bb6a246a
commit c904807b0a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View File

@ -15,6 +15,7 @@ HumHub Changelog
- Fix #7419: Reset modal window after close
- Fix #7428: Fix picker autofocus
- Enh #7424: New event on get registration groups
- Enh #7437: Add beforeInitCallback `humhub.ui.picker`
1.17.0 (January 13, 2025)
-------------------------

View File

@ -22,6 +22,11 @@ humhub.module('ui.picker', function (module, require, $) {
this.options.dataAdapter = $.fn.select2.amd.require('select2/data/extended-ajax');
}
}
if (this.options.beforeInitCallback && typeof window[this.options.beforeInitCallback] === 'function') {
this.options = window[this.options.beforeInitCallback].call(null, this.options);
}
_initSelect2(this.$, this.options);
};