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:
37
InvenTree/static/css/bootstrap-treeview.css
vendored
Normal file
37
InvenTree/static/css/bootstrap-treeview.css
vendored
Normal 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;
|
||||
}
|
@ -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;
|
||||
}
|
1249
InvenTree/static/script/bootstrap-treeview.js
vendored
Normal file
1249
InvenTree/static/script/bootstrap-treeview.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
9
InvenTree/static/script/sidenav.js
Normal file
9
InvenTree/static/script/sidenav.js
Normal 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";
|
||||
}
|
20
InvenTree/static/script/trees.js
Normal file
20
InvenTree/static/script/trees.js
Normal 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
|
||||
}
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user