mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 11:40:58 +00:00
Consolidated 'Part' app views
- Improved templating - Part tree open/close status stored to session
This commit is contained in:
@ -47,7 +47,7 @@
|
||||
margin-right: 50px;
|
||||
margin-left: 50px;
|
||||
width: 100%;
|
||||
transition: 0.5s;
|
||||
transition: 0.1s;
|
||||
}
|
||||
|
||||
.body {
|
||||
@ -88,7 +88,7 @@
|
||||
position: fixed; /* Stay in place */
|
||||
background-color: #fff; /* Black*/
|
||||
overflow-x: hidden; /* Disable horizontal scroll */
|
||||
transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
|
||||
transition: 0.1s; /* 0.5 second transition effect to slide in the sidenav */
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
|
@ -1,9 +1,52 @@
|
||||
function loadTree(url, tree, data) {
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (response.tree) {
|
||||
$(tree).treeview({
|
||||
data: response.tree,
|
||||
enableLinks: true
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
//TODO
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function openSideNav() {
|
||||
document.getElementById("sidenav").style.width = "250px";
|
||||
document.getElementById("inventree-content").style.marginLeft = "270px";
|
||||
|
||||
sessionStorage.setItem('inventree-sidenav-state', 'open');
|
||||
}
|
||||
|
||||
function closeSideNav() {
|
||||
document.getElementById("sidenav").style.width = "0";
|
||||
document.getElementById("inventree-content").style.marginLeft = "50px";
|
||||
|
||||
sessionStorage.setItem('inventree-sidenav-state', 'closed');
|
||||
}
|
||||
|
||||
function toggleSideNav(nav) {
|
||||
if ($(nav).width() == 0) {
|
||||
openSideNav();
|
||||
}
|
||||
else {
|
||||
closeSideNav();
|
||||
}
|
||||
}
|
||||
|
||||
function initSideNav() {
|
||||
if (sessionStorage.getItem("inventree-sidenav-state") && sessionStorage.getItem('inventree-sidenav-state') == 'open') {
|
||||
openSideNav();
|
||||
}
|
||||
else {
|
||||
closeSideNav();
|
||||
}
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
function loadTree(url, tree, data) {
|
||||
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'get',
|
||||
dataType: 'json',
|
||||
data: data,
|
||||
success: function (response) {
|
||||
if (response.tree) {
|
||||
$(tree).treeview({
|
||||
data: response.tree,
|
||||
enableLinks: true
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
//TODO
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user