fix: enable saving in price-list's price edit modal

This commit is contained in:
Valentin Lab
2025-10-15 11:56:46 +02:00
parent 1f02c932a0
commit 29f46b7287

View File

@@ -75,12 +75,12 @@
if (typeof(tinyMCE) != 'undefined') {
tinyMCE.triggerSave();
}
$('form ' + form_id).submit();
getModalForm(form_id).trigger('submit');
status = 1;
}
function handlePostModal(form_id, url_save, callback) {
$('form ' + form_id).submit(function(e) {
getModalForm(form_id).off('submit').on('submit', function(e) {
e.preventDefault();
var formData = new FormData(this);
$.ajax({
@@ -98,6 +98,15 @@
});
});
}
function getModalForm(form_id) {
var $form = $(form_id);
if (! $form.length) {
$form = $('form' + form_id);
}
return $form;
}
</script>
@endpush