Skip to content

Commit

Permalink
Fix getting drawer width
Browse files Browse the repository at this point in the history
  • Loading branch information
seicke committed Aug 27, 2024
1 parent 58359ba commit 926e66c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions aas-gui/Frontend/aas-web-gui/src/components/MainWindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,12 @@ export default defineComponent({
let screenWidth = document.getElementsByTagName('html')[0].clientWidth; // the width of the screen (Window) excluding the scrollbar
let navigationDrawer: any = document.getElementsByClassName('leftMenu')[0]; // the width of the navigation drawer
let isDrawerOpen: boolean = navigationDrawer.style.transform == 'translateX(0px)'; // checks if the navigation drawer is open
screenWidth = screenWidth - (isDrawerOpen ? navigationDrawer[0].clientWidth : 0); // if the navigation drawer is open subtract the width of the navigation drawer from the screen width
screenWidth = screenWidth - (isDrawerOpen ? navigationDrawer.clientWidth : 0); // if the navigation drawer is open subtract the width of the navigation drawer from the screen width
let diffX = parseInt(e.pageX) - pageX; // amount the header was dragged (minus - left, plus - right)
let minimalColWith = 200;
if ((curColWidth + diffX) >= minimalColWith
&& (nxtColWidth - diffX) >= minimalColWith) {
if ((curColWidth + diffX) >= minimalColWith && (nxtColWidth - diffX) >= minimalColWith) {
if(curCol) curCol.style.width = (100 - ((screenWidth - (curColWidth + diffX)) / screenWidth) * 100) + '%'; // scale the current Column (Window)
if(nxtCol) nxtCol.style.width = (100 - ((screenWidth - (nxtColWidth - diffX)) / screenWidth) * 100) + '%'; // scale the next Column (Window) if it exists
}
});
// Eventlistener to clear the local Variables mouse up
Expand Down

0 comments on commit 926e66c

Please sign in to comment.