diff --git a/resources/views/invoices/edit.blade.php b/resources/views/invoices/edit.blade.php index 6409f2bb7650..b83eb54998e0 100644 --- a/resources/views/invoices/edit.blade.php +++ b/resources/views/invoices/edit.blade.php @@ -1472,10 +1472,9 @@ } @if (Auth::user()->canCreateOrEdit(ENTITY_INVOICE, $invoice)) - if (NINJA.formIsSubmitted) { + if ($('#saveButton').is(':disabled')) { return false; } - NINJA.formIsSubmitted = true; $('#saveButton, #emailButton, #draftButton').attr('disabled', true); // if save fails ensure user can try again $.post('{{ url($url) }}', $('.main-form').serialize(), function(data) { @@ -1497,7 +1496,6 @@ function handleSaveFailed(data) { $('#saveButton, #emailButton, #draftButton').attr('disabled', false); $('#emailModal div.modal-footer button').attr('disabled', false); - NINJA.formIsSubmitted = false; var error = ''; if (data) { var error = firstJSONError(data.responseJSON) || data.statusText; diff --git a/resources/views/master.blade.php b/resources/views/master.blade.php index 11fb3d8edd4f..f5ab02226fb5 100644 --- a/resources/views/master.blade.php +++ b/resources/views/master.blade.php @@ -272,7 +272,6 @@