Fix flight field bugs
This commit is contained in:
@@ -100,7 +100,7 @@
|
||||
</body>
|
||||
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.0.6/js/all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/pjax@0.2.5/pjax.js"></script>
|
||||
{{--<script src="https://cdn.jsdelivr.net/npm/pjax@0.2.5/pjax.js"></script>--}}
|
||||
|
||||
<script src="{{ public_asset('/assets/admin/js/vendor.js') }}"></script>
|
||||
<script src="{{ public_asset('/assets/system/js/phpvms.js') }}"></script>
|
||||
|
||||
@@ -9,8 +9,21 @@
|
||||
</thead>
|
||||
@endif
|
||||
<tbody>
|
||||
@foreach($flight_fields as $field)
|
||||
@php
|
||||
#
|
||||
# A little nasty having logic like this in a template, but we need
|
||||
# to filter out the field values that have already been shown, since
|
||||
# they were values set because they had a FlightField parent
|
||||
#
|
||||
$shown = [];
|
||||
@endphp
|
||||
@foreach($flight_fields->concat($flight->field_values) as $field)
|
||||
@php
|
||||
if(in_array($field->name, $shown, true)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$shown[] = $field->name;
|
||||
$val_field = $flight->field_values->where('name', $field->name)->first();
|
||||
@endphp
|
||||
<tr>
|
||||
|
||||
@@ -63,12 +63,16 @@ $(document).ready(function () {
|
||||
setEditable();
|
||||
setFieldsEditable();
|
||||
|
||||
/*const pjax = new Pjax({
|
||||
elements: 'form[action]',
|
||||
selectors: ['.pjax_subfleet_form'],
|
||||
switches: {
|
||||
'#subfleet_flight_wrapper': Pjax.switches.replaceNode
|
||||
}
|
||||
/*new Pjax({
|
||||
elements: 'form[action].pjax_subfleet_form',
|
||||
selectors: ['div#subfleet_flight_wrapper'],
|
||||
history: false,
|
||||
});
|
||||
|
||||
new Pjax({
|
||||
elements: 'form[action].pjax_flight_fields',
|
||||
selectors: ['div#flight_fields_wrapper'],
|
||||
history: false
|
||||
});*/
|
||||
|
||||
$(document).on('submit', 'form.pjax_flight_fields', function (event) {
|
||||
|
||||
Reference in New Issue
Block a user