fix: enable saving in price-list's price edit modal
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user