Skip to content

Commit afb9809

Browse files
committed
tools: localhost: move filtering options to sidebar
Move the TDF and application filtering options to a toggleable sidebar. This fixes the filtering tables jumping around as the filtering options are changed, and allows the entire screen space to be used for the table. Signed-off-by: Jordan Yates <jordan@embeint.com>
1 parent 40ea3ab commit afb9809

1 file changed

Lines changed: 40 additions & 11 deletions

File tree

src/infuse_iot/tools/localhost/index.html

Lines changed: 40 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,17 @@
1515
font-family: monospace;
1616
}
1717

18+
.sidebar {
19+
height: 100%; /* 100% Full-height */
20+
width: 0; /* 0 width - change this with JavaScript */
21+
position: fixed; /* Stay in place */
22+
z-index: 1; /* Stay on top */
23+
top: 0;
24+
right: 0;
25+
background-color: #ffffff; /* White */
26+
overflow-x: hidden; /* Disable horizontal scroll */
27+
}
28+
1829
#tdf-show {
1930
vertical-align: top;
2031
}
@@ -26,20 +37,38 @@
2637

2738
<body>
2839
<h1>Infuse-IoT TDF Viewer</h1>
29-
<p>
40+
41+
<div id="filteringSidebar" class="sidebar">
42+
<span id="tdf-show"></span>
43+
<span id="app-show"></span>
44+
</div>
45+
<div>
46+
<b>
47+
Filtering:
48+
<button class="openbtn" onclick="openFiltering()">&#9776; Options</button>
49+
</b>
50+
51+
<b>
52+
<label for="update_pause">Pause updating: </label>
53+
<input type="checkbox" id="update_pause" name="update_pause" value="pause">
54+
</b>
55+
</div>
3056
<div id="data-table"></div>
31-
</p>
32-
<p>
33-
<h2>Table Control
34-
<label for="update_pause"> (Pause updating</label>
35-
<input type="checkbox" id="update_pause" name="update_pause" value="pause">
36-
)
37-
</h2>
38-
<span id="tdf-show"></span>
39-
<span id="app-show"></span>
40-
</p>
4157

4258
<script>
59+
// Filtering controls visible or not
60+
function openFiltering() {
61+
let elem = document.getElementById("filteringSidebar");
62+
let open_width = "275px";
63+
64+
// Toggle sidebar with filtering options
65+
if (elem.style.width == open_width) {
66+
elem.style.width = "0px";
67+
} else {
68+
elem.style.width = open_width;
69+
}
70+
}
71+
4372
let filtering_update = false;
4473
// Initialize the Tabulator table
4574
const dataTable = new Tabulator("#data-table", {

0 commit comments

Comments
 (0)