mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Prevent clicking save while document is still uploading
This commit is contained in:
parent
1531727188
commit
ba561c7d0d
@ -1311,6 +1311,8 @@ $LANG = array(
|
||||
'new_start_date' => 'New start date',
|
||||
'security' => 'Security',
|
||||
'see_whats_new' => 'See what\'s new in v:version',
|
||||
'wait_for_upload' => 'Please wait for the document upload to complete.'
|
||||
|
||||
);
|
||||
|
||||
return $LANG;
|
||||
|
@ -1265,6 +1265,11 @@
|
||||
}
|
||||
|
||||
function onFormSubmit(event) {
|
||||
if (window.countUploadingDocuments > 0) {
|
||||
alert("{!! trans('texts.wait_for_upload') !!}");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isSaveValid()) {
|
||||
model.showClientForm();
|
||||
return false;
|
||||
@ -1435,6 +1440,7 @@
|
||||
model.invoice().invoice_number(number);
|
||||
}
|
||||
|
||||
window.countUploadingDocuments = 0;
|
||||
@if ($account->hasFeature(FEATURE_DOCUMENTS))
|
||||
function handleDocumentAdded(file){
|
||||
// open document when clicked
|
||||
@ -1446,6 +1452,7 @@
|
||||
if(file.mock)return;
|
||||
file.index = model.invoice().documents().length;
|
||||
model.invoice().addDocument({name:file.name, size:file.size, type:file.type});
|
||||
window.countUploadingDocuments++;
|
||||
}
|
||||
|
||||
function handleDocumentRemoved(file){
|
||||
@ -1456,6 +1463,7 @@
|
||||
function handleDocumentUploaded(file, response){
|
||||
file.public_id = response.document.public_id
|
||||
model.invoice().documents()[file.index].update(response.document);
|
||||
window.countUploadingDocuments--;
|
||||
refreshPDF(true);
|
||||
|
||||
if(response.document.preview_url){
|
||||
|
Loading…
x
Reference in New Issue
Block a user