Fix bug on select2 in modal filters, add filters by tags and shelves on articles
This commit is contained in:
@@ -4,25 +4,43 @@
|
||||
<script src="/assets/plugins/select2/js/i18n/{{ App::getLocale() }}.js"></script>
|
||||
|
||||
<script>
|
||||
function initSelect2(sel) {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.select2' : sel;
|
||||
$(selector).select2({
|
||||
placeholder: "{{ __('select_a_value') }}",
|
||||
allowClear: false,
|
||||
width: {
|
||||
value: '100%'
|
||||
}
|
||||
});
|
||||
function initSelect2(sel, parent) {
|
||||
console.log('initSelect2');
|
||||
// $.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||
|
||||
$(document).on('select2:open',(e) => {
|
||||
var selector = (typeof(sel) == 'undefined') ? '.select2' : sel;
|
||||
|
||||
if (typeof(parent) == 'undefined') {
|
||||
$(selector).select2({
|
||||
placeholder: "{{ __('select_a_value') }}",
|
||||
allowClear: false,
|
||||
width: {
|
||||
value: '100%'
|
||||
}
|
||||
});
|
||||
} else {
|
||||
$(selector).select2({
|
||||
placeholder: "{{ __('select_a_value') }}",
|
||||
allowClear: true,
|
||||
dropdownParent: $(parent),
|
||||
width: {
|
||||
value: '100%'
|
||||
}
|
||||
});
|
||||
}
|
||||
/*
|
||||
$(selector).on('select2:open',(e) => {
|
||||
let t = $(e.target);
|
||||
console.log(t);
|
||||
if (t && t.length) {
|
||||
let id = t[0].id || t[0].name;
|
||||
let item = document.querySelector(`input[aria-controls*='${id}']`);
|
||||
console.log(id);
|
||||
let item = $(`input[aria-controls*='${id}']`);
|
||||
console.log(item);
|
||||
return item ? item.focus() : false;
|
||||
}
|
||||
});
|
||||
*/
|
||||
}
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user