[geary/wip/778025-conversation-height-0.12: 5/5] Use doc element's scrollHeight as ClientWebView's preferred height
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/778025-conversation-height-0.12: 5/5] Use doc element's scrollHeight as ClientWebView's preferred height
- Date: Sun, 14 Oct 2018 01:27:39 +0000 (UTC)
commit 721c5945a0e472e3a3b2f60965233f3e1e271e2b
Author: Michael Gratton <mike vee net>
Date: Sun Oct 14 11:55:46 2018 +1100
Use doc element's scrollHeight as ClientWebView's preferred height
This seems to be a bit more accurate than the previous calculation.
Force the doc element's border to zero as well to make using
scrollHeight more reliable.
ui/client-web-view.js | 12 +-----------
ui/conversation-web-view.css | 1 +
2 files changed, 2 insertions(+), 11 deletions(-)
---
diff --git a/ui/client-web-view.js b/ui/client-web-view.js
index e3b85b0e..a4542133 100644
--- a/ui/client-web-view.js
+++ b/ui/client-web-view.js
@@ -71,17 +71,7 @@ PageState.prototype = {
}, false); // load does not bubble
},
getPreferredHeight: function() {
- let html = window.document.documentElement;
- let height = html.offsetHeight;
- let computed = window.getComputedStyle(html);
- let top = computed.getPropertyValue('margin-top');
- let bot = computed.getPropertyValue('margin-bottom');
-
- return (
- height
- + parseInt(top.substring(0, top.length - 2))
- + parseInt(bot.substring(0, bot.length - 2))
- );
+ return window.document.documentElement.scrollHeight;
},
loaded: function() {
this.isLoaded = true;
diff --git a/ui/conversation-web-view.css b/ui/conversation-web-view.css
index 0040bca3..d2ca87a1 100644
--- a/ui/conversation-web-view.css
+++ b/ui/conversation-web-view.css
@@ -24,6 +24,7 @@ html {
expanding web view */
box-sizing: border-box !important;
margin: 0 !important;
+ border-width: 0 !important;
}
body {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]