Stock locations are now persistent

This commit is contained in:
Oliver Walters 2019-08-29 15:52:32 +10:00
parent ef674061de
commit 0fba236eef

View File

@ -54,6 +54,19 @@
{% endblock %} {% endblock %}
{% block js_ready %} {% block js_ready %}
{{ block.super }} {{ block.super }}
if (sessionStorage.getItem("inventree-show-part-locations")) {
$("#collapse-item-locations").collapse('show');
}
$("#collapse-item-locations").on('shown.bs.collapse', function() {
sessionStorage.setItem('inventree-show-part-locations', 1);
});
$("#collapse-item-locations").on('hidden.bs.collapse', function() {
sessionStorage.removeItem('inventree-show-part-locations');
});
$('#location-create').click(function () { $('#location-create').click(function () {
launchModalForm("{% url 'stock-location-create' %}", launchModalForm("{% url 'stock-location-create' %}",
{ {