Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Noah Lancien
a6094f8588 fix: 🐛 remove jquery syntax in pro dashboard 2026-07-06 12:37:58 +02:00

View file

@ -155,28 +155,36 @@
@push('scripts')
<script>
function setMpSelector() {
var selectMP = $('select[name=mps]');
$('.mp--bloc:visible:first').find('.mp--bloc--header .cotations--mp span').hide();
$('.mp--bloc:visible:first').find('.mp--bloc--header .cotations--mp').append(selectMP);
}
document.addEventListener('DOMContentLoaded', function() {
const selectMP = document.querySelector('select[name="mps"]');
if (!selectMP) return;
$(document).ready(function() {
setMpSelector();
selectMP.addEventListener('change', function() {
const value = this.value;
const blocs = document.querySelectorAll('.mp--bloc');
$('select[name=mps]').change(function (){
if($(this).val() == 'All') {
$('select[name=mps]')[0].selectedIndex = 0;
$('.mp--bloc .mp--bloc--header .cotations--mp span').show();
$('.mp--bloc').removeClass('final');
$('.mp--bloc').show();
if (value === 'All') {
this.selectedIndex = 0;
document.querySelectorAll('.mp--bloc .mp--bloc--header .cotations--mp span').forEach(function(span) {
span.style.display = '';
});
blocs.forEach(function(bloc) {
bloc.classList.remove('final');
bloc.style.display = '';
});
} else {
$('.mp--bloc').hide();
$('.mp--bloc.'+$(this).val()).addClass('final');
$('.mp--bloc.'+$(this).val()).show();
blocs.forEach(function(bloc) {
bloc.style.display = 'none';
bloc.classList.remove('final');
});
document.querySelectorAll('.mp--bloc.' + CSS.escape(value)).forEach(function(bloc) {
bloc.classList.add('final');
bloc.style.display = '';
});
}
setMpSelector();
//restore
});
});
</script>