mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-25 05:34:06 -08:00
Updated variable names for clarity, remove the concat of order and sort
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
165f9545ac
commit
dd3b2da670
|
@ -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;
|
||||
}
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue