Skip to content

Commit 6799f64

Browse files
committed
dynamically adjust height of webview
1 parent b26c9be commit 6799f64

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/renderer/components/BrowserMainView.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,9 @@
253253
this.getWebView().style.height = '100vh';
254254
},
255255
onLeaveHtmlFullScreen() {
256-
this.$el.querySelector('#nav').style.display = 'block';
257-
this.getWebView().style.height = 'calc(100vh - 73px)';
256+
const nav = this.$el.querySelector('#nav');
257+
nav.style.display = 'block';
258+
this.getWebView().style.height = `calc(100vh - ${nav.clientHeight}px)`;
258259
},
259260
onNewWindow(event, pageIndex) {
260261
this.$store.dispatch('incrementPid');

src/renderer/components/BrowserMainView/Page.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,10 @@
204204
}
205205
});
206206
207+
const nav = this.$parent.$el.querySelector('#nav');
207208
webview.style.height
208-
= `calc(100vh - ${document.getElementById('nav').getBoundingClientRect().bottom}px)`;
209+
= `calc(100vh - ${nav.clientHeight}px)`;
210+
this.$el.querySelector('.findinpage-bar').style.top = `${nav.clientHeight}px`;
209211
this.navigateTo(this.page.location);
210212
},
211213
beforeDestroy() {
@@ -263,7 +265,6 @@
263265
}
264266
265267
.findinpage-bar {
266-
top: 73px;
267268
right: 0px;
268269
background: rgba(128, 128, 128, 0.6);
269270
border-bottom-left-radius: 4px;

0 commit comments

Comments
 (0)