mirror of
https://github.com/inventree/InvenTree.git
synced 2025-04-29 20:16:44 +00:00
Part category collapse is persistent
This commit is contained in:
parent
9d11307152
commit
ef674061de
@ -36,9 +36,9 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% if category and category.children.all|length > 0 %}
|
{% if category and category.children.all|length > 0 %}
|
||||||
{% include "part/subcategories.html" with children=category.children.all collapse_id="children"%}
|
{% include "part/subcategories.html" with children=category.children.all collapse_id="categories" %}
|
||||||
{% elif children|length > 0 %}
|
{% elif children|length > 0 %}
|
||||||
{% include "part/subcategories.html" with children=children %}
|
{% include "part/subcategories.html" with children=children collapse_id="categories" %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<hr>
|
<hr>
|
||||||
|
|
||||||
@ -65,6 +65,18 @@
|
|||||||
{% block js_ready %}
|
{% block js_ready %}
|
||||||
{{ block.super }}
|
{{ block.super }}
|
||||||
|
|
||||||
|
if (sessionStorage.getItem("inventree-show-part-categories")) {
|
||||||
|
$("#collapse-item-categories").collapse('show');
|
||||||
|
}
|
||||||
|
|
||||||
|
$("#collapse-item-categories").on('shown.bs.collapse', function() {
|
||||||
|
sessionStorage.setItem('inventree-show-part-categories', 1);
|
||||||
|
});
|
||||||
|
|
||||||
|
$("#collapse-item-categories").on('hidden.bs.collapse', function() {
|
||||||
|
sessionStorage.removeItem('inventree-show-part-categories');
|
||||||
|
});
|
||||||
|
|
||||||
$("#cat-create").click(function() {
|
$("#cat-create").click(function() {
|
||||||
launchModalForm(
|
launchModalForm(
|
||||||
"{% url 'category-create' %}",
|
"{% url 'category-create' %}",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user