mirror of
https://github.com/humhub/humhub.git
synced 2025-01-16 21:58:17 +01:00
Fix initialization of several select2 inputs on the same page (#7182)
This commit is contained in:
parent
137446a670
commit
122a26c6d2
@ -20,6 +20,7 @@ HumHub Changelog
|
||||
- Fix #324: Focus on active and selected nav page after reload on mobile
|
||||
- Fix #7170: Fix rendering of new line on email messages
|
||||
- Fix #7178: Highlight only words with 3 or more characters
|
||||
- Fix #7182: Fix initialization of several select2 inputs on the same page
|
||||
|
||||
1.16.1 (July 1, 2024)
|
||||
---------------------
|
||||
|
@ -192,17 +192,19 @@ humhub.module('ui.additions', function (module, require, $) {
|
||||
: item.text;
|
||||
};
|
||||
|
||||
$match.select2({
|
||||
theme: 'humhub',
|
||||
tags: typeof $match.data('ui-select2-allow-new') !== 'undefined',
|
||||
insertTag: function (data, tag) {
|
||||
if (typeof $match.data('ui-select2-new-sign') !== 'undefined') {
|
||||
tag.text += ' ' + $match.data('ui-select2-new-sign');
|
||||
}
|
||||
data.unshift(tag);
|
||||
},
|
||||
templateResult: templateItem,
|
||||
templateSelection: templateItem,
|
||||
$match.each(function () {
|
||||
$(this).select2({
|
||||
theme: 'humhub',
|
||||
tags: typeof $(this).data('ui-select2-allow-new') !== 'undefined',
|
||||
insertTag: function (data, tag) {
|
||||
if (typeof $(this).data('ui-select2-new-sign') !== 'undefined') {
|
||||
tag.text += ' ' + $(this).data('ui-select2-new-sign');
|
||||
}
|
||||
data.unshift(tag);
|
||||
},
|
||||
templateResult: templateItem,
|
||||
templateSelection: templateItem,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user