Fix for subfleet add/remove on flight page #124
This commit is contained in:
35
resources/views/admin/flights/scripts.blade.php
Normal file
35
resources/views/admin/flights/scripts.blade.php
Normal file
@@ -0,0 +1,35 @@
|
||||
@section('scripts')
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
|
||||
$('#flight_fields_wrapper a.inline').editable({
|
||||
type: 'text',
|
||||
mode: 'inline',
|
||||
emptytext: '0',
|
||||
url: '/admin/flights/{!! $flight->id !!}/fields',
|
||||
ajaxOptions: {'type': 'put'},
|
||||
params: function (params) {
|
||||
return {
|
||||
field_id: params.pk,
|
||||
name: params.name,
|
||||
value: params.value
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pjax_flight_fields', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#flight_fields_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('submit', 'form.pjax_subfleet_form', function (event) {
|
||||
event.preventDefault();
|
||||
$.pjax.submit(event, '#subfleet_flight_wrapper', {push: false});
|
||||
});
|
||||
|
||||
$(document).on('pjax:complete', function () {
|
||||
$(".select2").select2();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endsection
|
||||
Reference in New Issue
Block a user