Fix some strange behavior

This commit is contained in:
acognet
2023-08-10 12:24:01 +02:00
parent b852e72088
commit 49cf6f5fe2
9 changed files with 45 additions and 29 deletions

View File

@@ -465,7 +465,10 @@ $('#datatable_dlg_{{ oUIBlock.GetId() }}').DataTableSettings(aOptions{{ sListIDF
$('body').append($('<form/>')
.attr({'method': 'post', 'id': 'basket{{ oUIBlock.GetId() }}'})
.append($('<input/>')
.attr({'type': 'hidden', 'name': 'filter', 'value': "{{ oUIBlock.GetFilter()|raw }}"})
.attr({'type': 'hidden', 'name': 'basket_filter', 'value': "{{ oUIBlock.GetBasketFilter()|raw }}"})
)
.append($('<input/>')
.attr({'type': 'hidden', 'name': 'basket_class', 'value': "{{ oUIBlock.GetBasketClass()|raw }}"})
)
.append($('<input/>')
.attr({'type': 'hidden', 'name': 'back_url', 'value': window.location.href})

View File

@@ -5,7 +5,8 @@
{% block iboNavigation %}
<form id='ibo-form-navigation' class='ibo-navigation-form' method='post'>
<input type='hidden' name='list_navigation' value='{{ oUIBlock.GetList() }}'/>
<input type='hidden' name='filter' value='{{ oUIBlock.GetFilter() }}'/>
<input type='hidden' name='basket_class' value='{{ oUIBlock.GetBasketClass() }}'/>
<input type='hidden' name='basket_filter' value='{{ oUIBlock.GetBasketFilter() }}'/>
<input type='hidden' name='back_posted_fields' value='{{ oUIBlock.GetPostedFields()|raw }}'/>
<input type='hidden' name='back_url' value='{{ oUIBlock.GetBackUrl()|raw }}'/>
<div class='ibo-form-navigation--nav fas fa-angle-up' id='{{ oUIBlock.GetId() }}-back'></div>

View File

@@ -2,11 +2,16 @@
{# @license http://opensource.org/licenses/AGPL-3.0 #}
$('#{{ oUIBlock.GetId() }}-back').on('click', function () {
$('#ibo-form-navigation').attr('action', ' {{ oUIBlock.GetBackUrl() | raw }} ');
$('#ibo-form-navigation').attr('action', '{{ oUIBlock.GetBackUrl() | raw }}');
$('#ibo-form-navigation').attr('method', 'post');
$('#ibo-form-navigation').find('[name=basket_filter]').val('');
JSON.parse('{{ oUIBlock.GetPostedFields() | raw }}', (key, value) => {
$('#ibo-form-navigation').append($('<input/>').attr({'type': 'hidden', 'name': key, 'value': value}));
});
if ('{{ oUIBlock.GetPostedFields() | raw }}' != '')
{
JSON.parse('{{ oUIBlock.GetPostedFields() | raw }}', (key, value) => {
$('#ibo-form-navigation').append($('<input/>').attr({'type': 'hidden', 'name': key, 'value': value}));
});
}
$('#ibo-form-navigation').submit();
});