mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-04 19:05:37 +08:00
Merge pull request #3372 from artoscinote/ma_SCI_5789
Fix issue with submit event binding multiple times [SCI-5789]
This commit is contained in:
commit
2ae8f4a2a1
1 changed files with 17 additions and 20 deletions
|
@ -226,26 +226,24 @@
|
||||||
clearDropdownResultsCallback(INVENTORY_PICKER);
|
clearDropdownResultsCallback(INVENTORY_PICKER);
|
||||||
}
|
}
|
||||||
|
|
||||||
function initializeSubmitAction() {
|
$('#content-reports-index').on('click', '#savePDFtoInventorySubmit', function() {
|
||||||
$('#content-reports-index').on('click', '#savePDFtoInventorySubmit', function() {
|
animateSpinner();
|
||||||
animateSpinner();
|
$.ajax({
|
||||||
$.ajax({
|
url: $('#savePDFtoInventorySubmit').data('target-url'),
|
||||||
url: $('#savePDFtoInventorySubmit').data('target-url'),
|
data: SELECTED_IDS,
|
||||||
data: SELECTED_IDS,
|
type: 'POST',
|
||||||
type: 'POST',
|
success: function(data) {
|
||||||
success: function(data) {
|
animateSpinner(null, false);
|
||||||
animateSpinner(null, false);
|
HelperModule.flashAlertMsg(data.message, 'success');
|
||||||
HelperModule.flashAlertMsg(data.message, 'success');
|
$('#savePDFtoInventory').modal('hide');
|
||||||
$('#savePDFtoInventory').modal('hide');
|
},
|
||||||
},
|
error: function(xhr) {
|
||||||
error: function(xhr) {
|
animateSpinner(null, false);
|
||||||
animateSpinner(null, false);
|
HelperModule.flashAlertMsg(xhr.responseJSON.message, 'danger');
|
||||||
HelperModule.flashAlertMsg(xhr.responseJSON.message, 'danger');
|
$('#savePDFtoInventory').modal('hide');
|
||||||
$('#savePDFtoInventory').modal('hide');
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* INITIALIZERS
|
* INITIALIZERS
|
||||||
|
@ -254,7 +252,6 @@
|
||||||
function initializeSavePDFtoInventoryModal() {
|
function initializeSavePDFtoInventoryModal() {
|
||||||
$('#content-reports-index').on('shown.bs.modal', '#savePDFtoInventory', function() {
|
$('#content-reports-index').on('shown.bs.modal', '#savePDFtoInventory', function() {
|
||||||
initInventoriesSelectPicker();
|
initInventoriesSelectPicker();
|
||||||
initializeSubmitAction();
|
|
||||||
clearErrors();
|
clearErrors();
|
||||||
// refresh the dropdown state
|
// refresh the dropdown state
|
||||||
$('#selectInventory').parent().find('input').trigger('keyup');
|
$('#selectInventory').parent().find('input').trigger('keyup');
|
||||||
|
|
Loading…
Add table
Reference in a new issue