[geary/wip/message-body-hight: 2/2] ClientWebView: Use HTML element's height to determine preferred
- From: Michael Gratton <mjog src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/message-body-hight: 2/2] ClientWebView: Use HTML element's height to determine preferred
- Date: Tue, 16 Jul 2019 02:20:09 +0000 (UTC)
commit c27d25003278a788b9e04661404c090f33cfa247
Author: Michael Gratton <mike vee net>
Date: Mon May 6 21:43:06 2019 +1000
ClientWebView: Use HTML element's height to determine preferred
Return the scroll height of the HTML element since the BODY
may have margin/border/padding and we want to know
precisely how high the widget needs to be to avoid
scrolling.
ui/client-web-view.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/ui/client-web-view.js b/ui/client-web-view.js
index 8f71594f..75bdecf1 100644
--- a/ui/client-web-view.js
+++ b/ui/client-web-view.js
@@ -90,7 +90,11 @@ PageState.prototype = {
}, false); // load does not bubble
},
getPreferredHeight: function() {
- return window.document.body.scrollHeight;
+ // Return the scroll height of the HTML element since the BODY
+ // may have margin/border/padding and we want to know
+ // precisely how high the widget needs to be to avoid
+ // scrolling.
+ return window.document.documentElement.scrollHeight;
},
getHtml: function() {
return document.body.innerHTML;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]