Skip to content

Commit

Permalink
replaced onchange event with change eventlistener
Browse files Browse the repository at this point in the history
  • Loading branch information
Corepex authored and aryaantony92 committed May 5, 2023
1 parent 75a3482 commit 9a6a16f
Showing 1 changed file with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
{% endif %}
<!--suppress HtmlFormInputWithoutLabel -->
<select
id="filterDefinition[id]"
name="filterDefinition[id]"
onchange="this.form.submit()"
class="form-control plugin-select2"
data-select2-options='{{ {'width': '50%'} | json_encode() }}'
id="filterDefinition-id"
name="filterDefinition[id]"
class="form-control plugin-select2"
data-select2-options='{{ {'width': '50%'} | json_encode() }}'
>
<option value="0">{{ 'cmf_filters_no_filter_selected' | trans({}, 'admin') }}</option>
{% for singleFilterDefinition in filterDefinitions %}
Expand All @@ -38,11 +37,18 @@
</select>

<a class="btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></a>

</div>
{% endif %}
</div>

</div>

<script {{ pimcore_csp.getNonceHtmlAttribute()|raw }}>
window.addEventListener('load', function () {
$('#filterDefinition-id').on('change', (e) => {
e.target.closest('form').submit();
});
});
</script>
<!-- /.box-header -->

0 comments on commit 9a6a16f

Please sign in to comment.