phpvms/resources/views/admin/subfleets/script.blade.php
2017-12-30 13:39:56 -06:00

32 lines
829 B
PHP

@section('scripts')
<script>
$(document).ready(function() {
$('#aircraft_fares a').editable({
type: 'text',
mode: 'inline',
emptytext: 'default',
url: '/admin/subfleets/{!! $subfleet->id !!}/fares',
title: 'Enter override value',
ajaxOptions: { 'type': 'put'},
params: function(params) {
return {
fare_id: params.pk,
name: params.name,
value: params.value
}
}
});
$(document).on('submit', 'form.rm_fare', function(event) {
event.preventDefault();
console.log(event);
$.pjax.submit(event, '#aircraft_fares_wrapper', {push: false});
});
$(document).on('pjax:complete', function() {
$(".select2").select2();
});
});
</script>
@endsection