From 2c7319b42be8d9503585e5dc1ec7283e30dacc1f Mon Sep 17 00:00:00 2001 From: antoniandre Date: Sun, 11 Aug 2024 23:31:12 +0200 Subject: [PATCH] Cleanup. --- src/components/splitpanes/splitpanes.vue | 4 ++-- src/views/documentation.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/splitpanes/splitpanes.vue b/src/components/splitpanes/splitpanes.vue index 4e69ffd..1ed7af6 100644 --- a/src/components/splitpanes/splitpanes.vue +++ b/src/components/splitpanes/splitpanes.vue @@ -138,8 +138,7 @@ const getCurrentMouseDrag = event => { } } -// Returns the drag percentage of the splitter relative to the 2 panes it's in between. -// if the sum of size of the 2 cells is 60%, the dragPercentage range will be 0 to 100% of this 60%. +// Returns the drag percentage of the splitter relative to the container (ranging from 0 to 100%). const getCurrentDragPercentage = drag => { drag = drag[props.horizontal ? 'y' : 'x'] // In the code below 'size' refers to 'width' for vertical and 'height' for horizontal layout. @@ -264,6 +263,7 @@ const doPushOtherPanes = (sums, dragPercentage) => { } return { sums, panesToResize } } + const sumPrevPanesSize = splitterIndex => { return panes.value.reduce((total, pane, i) => total + (i < splitterIndex ? pane.size : 0), 0) } diff --git a/src/views/documentation.vue b/src/views/documentation.vue index 92221ed..0e4c2c2 100644 --- a/src/views/documentation.vue +++ b/src/views/documentation.vue @@ -296,7 +296,7 @@ //- Example. h3.mt12.pt8.mb2(id="lots-of-splitters") - a(href="#lots-of-splitters") Lots of splitters & push other panes - all panes have a min width of 5% + a(href="#lots-of-splitters") Lots of splitters & push other panes - all the panes have a min width of 5% splitpanes.default-theme.example(style="height: 400px") pane(v-for="i in 8" :key="i" :min-size="5") span {{ i }}