mirror of
https://github.com/inventree/InvenTree.git
synced 2025-05-02 13:28:49 +00:00
Remove treeview state saving.
This commit is contained in:
parent
40f73b00ce
commit
b6d9bc3093
@ -218,7 +218,6 @@ function enableBreadcrumbTree(options) {
|
|||||||
collapseIcon: 'fa fa-chevron-down',
|
collapseIcon: 'fa fa-chevron-down',
|
||||||
});
|
});
|
||||||
|
|
||||||
setBreadcrumbTreeState(label, state);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -226,26 +225,11 @@ function enableBreadcrumbTree(options) {
|
|||||||
$('#breadcrumb-tree-toggle').click(function() {
|
$('#breadcrumb-tree-toggle').click(function() {
|
||||||
// Add callback to "collapse" and "expand" the sidebar
|
// Add callback to "collapse" and "expand" the sidebar
|
||||||
|
|
||||||
// By default, the menu is "expanded"
|
// Toggle treeview visibilty
|
||||||
var state = localStorage.getItem(`inventree-tree-state-${label}`) || 'expanded';
|
$('#breadcrumb-tree-collapse').toggle();
|
||||||
|
|
||||||
// We wish to "toggle" the state!
|
|
||||||
setBreadcrumbTreeState(label, state == 'expanded' ? 'collapsed' : 'expanded');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Set the initial state (default = expanded)
|
|
||||||
var state = localStorage.getItem(`inventree-tree-state-${label}`) || 'expanded';
|
|
||||||
|
|
||||||
function setBreadcrumbTreeState(label, state) {
|
|
||||||
|
|
||||||
if (state == 'collapsed') {
|
|
||||||
$('#breadcrumb-tree-collapse').hide(100);
|
|
||||||
} else {
|
|
||||||
$('#breadcrumb-tree-collapse').show(100);
|
|
||||||
}
|
|
||||||
|
|
||||||
localStorage.setItem(`inventree-tree-state-${label}`, state);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user