2018-01-04 05:27:56 +08:00
|
|
|
@section('scripts')
|
|
|
|
<script>
|
2018-02-27 09:14:10 +08:00
|
|
|
function setEditable() {
|
2018-03-10 00:24:22 +08:00
|
|
|
|
|
|
|
@if(isset($rank))
|
2018-02-27 09:14:10 +08:00
|
|
|
$('#subfleets-table a').editable({
|
|
|
|
type: 'text',
|
|
|
|
mode: 'inline',
|
|
|
|
emptytext: 'inherited',
|
2018-03-13 06:58:12 +08:00
|
|
|
url: '{{ url('/admin/ranks/'.$rank->id.'/subfleets') }}',
|
2018-02-27 09:14:10 +08:00
|
|
|
title: 'Enter override value',
|
|
|
|
ajaxOptions: {'type': 'put'},
|
|
|
|
params: function (params) {
|
|
|
|
return {
|
|
|
|
subfleet_id: params.pk,
|
|
|
|
name: params.name,
|
|
|
|
value: params.value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2018-03-10 00:24:22 +08:00
|
|
|
@endif
|
2018-02-27 09:14:10 +08:00
|
|
|
}
|
|
|
|
|
2018-01-04 05:27:56 +08:00
|
|
|
$(document).ready(function () {
|
2018-02-27 09:14:10 +08:00
|
|
|
|
|
|
|
setEditable();
|
2018-01-04 05:27:56 +08:00
|
|
|
|
|
|
|
$(document).on('submit', 'form.pjax_form', function (event) {
|
|
|
|
event.preventDefault();
|
|
|
|
$.pjax.submit(event, '#rank_subfleet_wrapper', {push: false});
|
|
|
|
});
|
|
|
|
|
|
|
|
$(document).on('pjax:complete', function () {
|
|
|
|
$(".select2").select2();
|
2018-02-27 09:14:10 +08:00
|
|
|
setEditable();
|
2018-01-04 05:27:56 +08:00
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
@endsection
|