mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 21:24:13 -08:00
fixes checkout bug
This commit is contained in:
parent
0c6611d6bd
commit
1f7f9717c5
|
@ -17,7 +17,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
|
@ -90,7 +90,7 @@
|
|||
</div>
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box.box-default -->
|
||||
</form>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
{{ csrf_field() }}
|
||||
|
||||
|
@ -56,7 +56,7 @@
|
|||
</div> <!-- .BOX-BODY-->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ URL::previous() }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div> <!-- .box-default-->
|
||||
</form>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<div class="row">
|
||||
<div class="col-md-9">
|
||||
|
||||
<form class="form-horizontal" method="post" action="" autocomplete="off">
|
||||
<form class="form-horizontal" id="checkout_form" method="post" action="" autocomplete="off">
|
||||
<!-- CSRF Token -->
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}" />
|
||||
|
||||
|
@ -77,7 +77,7 @@
|
|||
</div> <!-- .box-body -->
|
||||
<div class="box-footer">
|
||||
<a class="btn btn-link" href="{{ route('consumables.show', ['consumable'=> $consumable->id]) }}">{{ trans('button.cancel') }}</a>
|
||||
<button type="submit" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
<button type="submit" id="submit_button" class="btn btn-primary pull-right"><i class="fas fa-check icon-white" aria-hidden="true"></i> {{ trans('general.checkout') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -1012,6 +1012,14 @@
|
|||
event.preventDefault();
|
||||
$(this).ekkoLightbox();
|
||||
});
|
||||
//This prevents multi-click checkouts for accessories, components, consumables
|
||||
$(document).ready(function () {
|
||||
$('#checkout_form').submit(function (event) {
|
||||
event.preventDefault();
|
||||
$('#submit_button').prop('disabled', true);
|
||||
this.submit();
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
|
Loading…
Reference in a new issue