Skip to content

Commit 3e653fa

Browse files
tree: make the toolbar sticky
* Ensure the ViewToolbar doesn't scroll out of view. * Closes #991
1 parent 7d449b2 commit 3e653fa

File tree

1 file changed

+32
-38
lines changed

1 file changed

+32
-38
lines changed

src/views/Tree.vue

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,44 +16,22 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
1616
-->
1717

1818
<template>
19-
<div class="h-100">
20-
<v-container
21-
fluid
22-
class="c-tree pa-2"
23-
data-cy="tree-view"
24-
>
25-
<!-- The Toolbar -->
26-
<v-row
27-
no-gutters
28-
class="d-flex flex-wrap"
29-
>
30-
<ViewToolbar
31-
:groups="controlGroups"
32-
@setOption="setOption"
33-
/>
34-
</v-row>
35-
36-
<!-- The Tree -->
37-
<v-row
38-
no-gutters
39-
class="mt-2"
40-
>
41-
<v-col
42-
cols="12"
43-
class="mh-100 position-relative"
44-
>
45-
<TreeComponent
46-
:workflows="workflows"
47-
:hoverable="false"
48-
:autoStripTypes="['workflow']"
49-
:node-filter-func="filterNode"
50-
:flat="flat"
51-
v-bind="{ expandAll, filterState }"
52-
ref="treeComponent"
53-
/>
54-
</v-col>
55-
</v-row>
56-
</v-container>
19+
<div class="h-100 c-tree">
20+
<ViewToolbar
21+
class="toolbar"
22+
:groups="controlGroups"
23+
@setOption="setOption"
24+
/>
25+
<TreeComponent
26+
class="tree"
27+
:workflows="workflows"
28+
:hoverable="false"
29+
:autoStripTypes="['workflow']"
30+
:node-filter-func="filterNode"
31+
:flat="flat"
32+
v-bind="{ expandAll, filterState }"
33+
ref="treeComponent"
34+
/>
5735
</div>
5836
</template>
5937

@@ -374,3 +352,19 @@ export default {
374352
},
375353
}
376354
</script>
355+
356+
<style scoped lang="scss">
357+
.c-tree {
358+
.toolbar {
359+
position: sticky;
360+
top: 0;
361+
background: white;
362+
z-index:1;
363+
padding: 0.5em;
364+
}
365+
.tree {
366+
margin: 0 0.5em 0 0.5em;
367+
width: calc(100% - 1em);
368+
}
369+
}
370+
</style>

0 commit comments

Comments
 (0)