Skip to content

Commit 9864acd

Browse files
committed
Add a show/hide toggle system for the left pane
Signed-off-by: tdruez <[email protected]>
1 parent 95c89c5 commit 9864acd

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

scanpipe/templates/scanpipe/resource_tree.html

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<div id="resource-tree-container" class="container is-fluid p-0">
2121
<div class="resizable-container is-flex">
2222
<div id="left-pane" class="left-pane px-2">
23+
{% include "scanpipe/tree/resource_left_pane_header.html" only %}
2324
<div id="resource-tree">
2425
{% include "scanpipe/tree/resource_left_pane_tree.html" with children=children path=path %}
2526
</div>
@@ -33,7 +34,7 @@
3334
hx-target="this">
3435
</div>
3536
{% else %}
36-
{% include "scanpipe/tree/resource_right_pane_table.html" %}
37+
{% include "scanpipe/tree/resource_right_pane.html" %}
3738
{% endif %}
3839
</div>
3940
</div>
@@ -140,6 +141,22 @@
140141
document.body.style.userSelect = '';
141142
}
142143
});
144+
145+
// Show/hide left pane
146+
const hidePaneButton = document.getElementById('hide-left-pane');
147+
hidePaneButton.addEventListener('click', function() {
148+
leftPane.classList.add('is-hidden');
149+
resizer.classList.add('is-hidden');
150+
151+
const expandPaneButton = document.getElementById('expand-left-pane');
152+
expandPaneButton.classList.remove('is-hidden');
153+
expandPaneButton.addEventListener('click', function() {
154+
leftPane.classList.remove('is-hidden');
155+
resizer.classList.remove('is-hidden');
156+
expandPaneButton.classList.add('is-hidden');
157+
});
158+
});
159+
143160
});
144161
</script>
145162
{% endblock %}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<div class="is-flex is-align-items-center mb-2">
2+
<button id="hide-left-pane" class="button is-light px-2">
3+
<i class="fa-solid fa-square-caret-left"></i>
4+
</button>
5+
<div class="is-size-5 has-text-weight-semibold ml-2">
6+
Resources
7+
</div>
8+
</div>

scanpipe/templates/scanpipe/tree/resource_path_breadcrumb.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<nav class="breadcrumb is-flex is-align-items-center" aria-label="breadcrumbs">
2+
<button id="expand-left-pane" class="button is-light px-2 mr-2 is-hidden">
3+
<i class="fa-solid fa-square-caret-right"></i>
4+
</button>
25
<ul>
36
{% for subpath, segment in path_segments %}
47
{% if not forloop.last %}

0 commit comments

Comments
 (0)