diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 531f7d429c..992162e3dc 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -164,23 +164,24 @@ // Initialize sort-order for bulk actions (label-generation) for snipe-tables $('.snipe-table').each(function (i, table) { table_cookie_segment = $(table).data('cookie-id-table'); - name = ''; - direction = ''; + sort = ''; + order = ''; cookies = document.cookie.split(";"); for(i in cookies) { cookiedef = cookies[i].split("=", 2); cookiedef[0] = cookiedef[0].trim(); if (cookiedef[0] == table_cookie_segment + ".bs.table.sortOrder") { - direction = cookiedef[1]; + order = cookiedef[1]; } if (cookiedef[0] == table_cookie_segment + ".bs.table.sortName") { - name = cookiedef[1]; + sort = cookiedef[1]; } } - if (name && direction) { + if (sort && order) { domnode = $($(this).data('bulk-form-id')).get(0); if ( domnode && domnode.elements && domnode.elements.sort ) { - domnode.elements.sort.value = name + " " + direction; + domnode.elements.sort.value = sort; + domnode.elements.order.value = order; } } }); @@ -190,7 +191,8 @@ domnode = $($(this).data('bulk-form-id')).get(0); // make safe in case there isn't a bulk-form-id, or it's not found, or has no 'sort' element if ( domnode && domnode.elements && domnode.elements.sort ) { - domnode.elements.sort.value = name + " " + order; + domnode.elements.sort.value = name; + domnode.elements.order.value = order; } });