Save grid / list selection to local storage settings

This commit is contained in:
Oliver Walters 2021-05-30 00:38:59 +10:00
parent e846c744f4
commit f1ca17286f

View File

@ -176,13 +176,12 @@
toggleId: '#category-menu-toggle',
});
$('#view-list').hide();
$('#view-list').click(function() {
$('#view-list').hide();
$('#view-grid').show();
$('#part-table').bootstrapTable('toggleCustomView');
inventreeSave('part-grid-view', '');
});
$('#view-grid').click(function() {
@ -190,6 +189,7 @@
$('#view-list').show();
$('#part-table').bootstrapTable('toggleCustomView');
inventreeSave('part-grid-view', 1);
});
$("#cat-create").click(function() {
@ -300,4 +300,11 @@
},
);
if (inventreeLoad("part-grid-view")) {
$('#view-grid').hide();
$('#part-table').bootstrapTable('toggleCustomView');
} else {
$('#view-list').hide();
}
{% endblock %}