Fixed #4784 - cookie not always being set correctly for ajax tables

This commit is contained in:
snipe 2018-01-10 20:04:41 -08:00
parent bab0bda174
commit c6a956382f
3 changed files with 9 additions and 17 deletions

View file

@ -1,10 +1,10 @@
{{-- This Will load our default bootstrap-table settings on any table with a class of "snipe-table" and export it to the passed 'exportFile' name --}} {{-- This Will load our default bootstrap-table settings on any table with a class of "snipe-table" and export it to the passed 'exportFile' name --}}
<script src="{{ asset('js/bootstrap-table.js') }}"></script> <script src="{{ asset('js/bootstrap-table.js') }}"></script>
<script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script> <script src="{{ asset('js/extensions/mobile/bootstrap-table-mobile.js') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.min.js?v=1') }}"></script>
@if (!isset($simple_view)) @if (!isset($simple_view))
<script src="{{ asset('js/extensions/export/bootstrap-table-export.js?v=1') }}"></script> <script src="{{ asset('js/extensions/export/bootstrap-table-export.js?v=1') }}"></script>
<script src="{{ asset('js/extensions/cookie/bootstrap-table-cookie.js?v=1') }}"></script>
<script src="{{ asset('js/extensions/export/tableExport.js') }}"></script> <script src="{{ asset('js/extensions/export/tableExport.js') }}"></script>
<script src="{{ asset('js/FileSaver.min.js') }}"></script> <script src="{{ asset('js/FileSaver.min.js') }}"></script>
<script src="{{ asset('js/jspdf.min.js') }}"></script> <script src="{{ asset('js/jspdf.min.js') }}"></script>
@ -36,31 +36,27 @@
classes: 'table table-responsive table-no-bordered', classes: 'table table-responsive table-no-bordered',
undefinedText: '', undefinedText: '',
iconsPrefix: 'fa', iconsPrefix: 'fa',
search: {{ (isset($search)) ? 'true' : 'false' }},
@if (isset($search))
search: true,
@endif
paginationVAlign: 'both', paginationVAlign: 'both',
sidePagination: '{{ (isset($clientSearch)) ? 'client' : 'server' }}', sidePagination: '{{ (isset($clientSearch)) ? 'client' : 'server' }}',
sortable: true, sortable: true,
pageSize: 20,
pagination: true,
cookie: true,
cookieExpire: '2y',
cookieIdTable: '{{ Route::currentRouteName() }}',
@if (!isset($simple_view)) @if (!isset($simple_view))
showRefresh: true, showRefresh: true,
pagination: true,
pageSize: 20,
cookie: true,
cookieExpire: '2y',
showExport: true, showExport: true,
stickyHeader: true, stickyHeader: true,
stickyHeaderOffsetY: stickyHeaderOffsetY + 'px', stickyHeaderOffsetY: stickyHeaderOffsetY + 'px',
@if (isset($showFooter)) @if (isset($showFooter))
showFooter: true, showFooter: true,
@endif @endif
showColumns: true, showColumns: true,
trimOnSearch: false, trimOnSearch: false,
@ -287,14 +283,10 @@
// We need a special formatter for license seats, since they don't work exactly the same // We need a special formatter for license seats, since they don't work exactly the same
// //
function licenseSeatInOutFormatter (value, row) { function licenseSeatInOutFormatter(value, row) {
if ((row.available_actions.checkout == true) && (row.user_can_checkout == true) && (!row.assigned_to)) {
return '<a href="{{ url('/') }}/' + destination + '/' + row.next_seat + '/checkout" class="btn btn-sm bg-maroon" data-tooltip="true" title="Check this item out to a user">{{ trans('general.checkout') }}</a>';
} else {
} }
}
function genericCheckinCheckoutFormatter(destination) { function genericCheckinCheckoutFormatter(destination) {
return function (value,row) { return function (value,row) {