phpvms/resources/views/admin/ranks/scripts.blade.php

37 lines
890 B
PHP
Raw Normal View History

2018-01-04 05:27:56 +08:00
@section('scripts')
<script>
function setEditable() {
$('#subfleets-table a').editable({
type: 'text',
mode: 'inline',
emptytext: 'inherited',
url: '{!! url('/admin/ranks/'.$rank->id.'/subfleets') !!}',
title: 'Enter override value',
ajaxOptions: {'type': 'put'},
params: function (params) {
return {
subfleet_id: params.pk,
name: params.name,
value: params.value
}
}
});
}
2018-01-04 05:27:56 +08:00
$(document).ready(function () {
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();
setEditable();
2018-01-04 05:27:56 +08:00
});
});
</script>
@endsection