mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #4479 from okriuchykhin/ok_SCI_7271
Fix label printing status modal [SCI-7271]
This commit is contained in:
commit
07d470b2ff
2 changed files with 16 additions and 9 deletions
|
@ -1,9 +1,15 @@
|
|||
(function() {
|
||||
var PrintProgressModal = (function() {
|
||||
'use strict';
|
||||
|
||||
function updateProgressModal() {
|
||||
var modal = $('.label-printing-progress-modal');
|
||||
|
||||
if (modal.length === 0) return;
|
||||
|
||||
$(document).on('click', '.label-printing-progress-modal .close', function() {
|
||||
$(this).closest('.label-printing-progress-modal').remove();
|
||||
});
|
||||
|
||||
$.getJSON(
|
||||
modal.data('progress-url'), function(data) {
|
||||
modal.replaceWith(data.html);
|
||||
|
@ -15,11 +21,7 @@
|
|||
);
|
||||
}
|
||||
|
||||
$(document).on('click', '.label-printing-progress-modal .close', function() {
|
||||
$(this).closest('.label-printing-progress-modal').remove();
|
||||
});
|
||||
|
||||
$(document).on('ajax:success', '.print-label-form', function(e, data) {
|
||||
function initialize(data) {
|
||||
var modal = $('.label-printing-progress-modal');
|
||||
if (modal.length) {
|
||||
modal.replaceWith(data.html);
|
||||
|
@ -27,7 +29,10 @@
|
|||
$('body').append($(data.html));
|
||||
}
|
||||
|
||||
updateProgressModal();
|
||||
$('#modal-print-repository-row-label').modal('hide');
|
||||
setTimeout(updateProgressModal, 3000);
|
||||
}
|
||||
|
||||
return Object.freeze({
|
||||
init: initialize
|
||||
});
|
||||
}());
|
||||
|
|
|
@ -234,8 +234,10 @@
|
|||
label_printer_id: this.selectedPrinter.id,
|
||||
label_template_id: this.selectedTemplate.id,
|
||||
copies: this.copies
|
||||
}, () => {
|
||||
}, (data) => {
|
||||
$(this.$refs.modal).modal('hide');
|
||||
this.$emit('close');
|
||||
PrintProgressModal.init(data);
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue