From 294efe5e8de49ffbf736e7febd0acdcb268c3255 Mon Sep 17 00:00:00 2001 From: Johannes Millan Date: Wed, 14 Nov 2018 00:32:56 +0100 Subject: [PATCH] feat(bookmarks): make split component work with dynamic header height --- src/app/app.component.html | 1 - src/app/pages/work-view/split/split.component.ts | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/app/app.component.html b/src/app/app.component.html index 0c2a11cb0a..88c51b2b3d 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,5 +1,4 @@ -

Yeahaha

45 && this.pos < 55) { newPos = 100; } this._updatePos(newPos); @@ -76,13 +76,11 @@ export class SplitComponent implements OnInit { this._renderer.removeClass(this.splitTopEl, ANIMATABLE_CLASS); this._renderer.removeClass(this.splitBottomEl, ANIMATABLE_CLASS); this._isDrag = true; - // console.log('onMouseDown', ev); + const bounds = this.containerEl.getBoundingClientRect(); const h = this.containerEl.offsetHeight; - // const handleHeight = this.buttonEl._elementRef.nativeElement.offsetHeight * 3 / 2; - const handleHeight = this.buttonEl._elementRef.nativeElement.offsetHeight * 2 / 2; - // console.log(handleHeight); + const headerHeight = bounds.top; - let percentage = (ev.clientY - handleHeight) / h * 100; + let percentage = (ev.clientY - headerHeight) / h * 100; if (percentage > 100) { percentage = 100; }