2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-07-02 11:40:58 +00:00

Implemented tree view

Using library bootstrap-treeview
- part category tree
- stock location tree
- Currenly is functional but looks terrible
This commit is contained in:
Oliver
2018-04-28 23:22:12 +10:00
parent 095492203f
commit 8d0789c37c
13 changed files with 1471 additions and 9 deletions

View File

@ -0,0 +1,37 @@
/* =========================================================
* bootstrap-treeview.css v1.2.0
* =========================================================
* Copyright 2013 Jonathan Miles
* Project URL : http://www.jondmiles.com/bootstrap-treeview
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ========================================================= */
.treeview .list-group-item {
cursor: pointer;
}
.treeview span.indent {
margin-left: 10px;
margin-right: 10px;
}
.treeview span.icon {
width: 12px;
margin-right: 5px;
}
.treeview .node-disabled {
color: silver;
cursor: not-allowed;
}

View File

@ -41,8 +41,17 @@
}
.inventree-content {
padding-left: 15px;
padding-right: 15px;
padding-left: 5px;
padding-right: 5px;
padding-top: 15px;
margin-right: 50px;
margin-left: 50px;
width: 100%;
transition: 0.5s;
}
.body {
padding-top: 70px;
}
.modal {
@ -61,4 +70,19 @@
max-height: calc(100vh - 200px) !important;
overflow-y: scroll;
padding: 10px;
}
/* The side navigation menu */
.sidenav {
height: 100%; /* 100% Full-height */
width: 0px; /* 0 width - change this with JavaScript */
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 */
}
.wrapper {
align-items: stretch;
display: flex;
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,9 @@
function openSideNav() {
document.getElementById("sidenav").style.width = "250px";
document.getElementById("inventree-content").style.marginLeft = "270px";
}
function closeSideNav() {
document.getElementById("sidenav").style.width = "0";
document.getElementById("inventree-content").style.marginLeft = "0";
}

View File

@ -0,0 +1,20 @@
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
}
});
}