[geary/wip/778025-conversation-height-0.12: 4/5] Check for ClientWebView preferred height changing in a few more cases



commit ab479b66329ff8a6db49ffc878fd02a0fdf12bb3
Author: Michael Gratton <mike vee net>
Date:   Sun Oct 14 11:52:52 2018 +1100

    Check for ClientWebView preferred height changing in a few more cases
    
    Queue a preferred height check on resize and transition end so we catch
    cases where the user resizes the window and transitions cause a height
    change after loading has completed, etc.

 ui/client-web-view.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/ui/client-web-view.js b/ui/client-web-view.js
index faab9ff0..e3b85b0e 100644
--- a/ui/client-web-view.js
+++ b/ui/client-web-view.js
@@ -57,6 +57,18 @@ PageState.prototype = {
         document.addEventListener("load", function(e) {
             queuePreferredHeightUpdate();
         }, true); // load does not bubble
+
+        // Queues an update if the window changes size, e.g. if the
+        // user resized the window
+        window.addEventListener("resize", function(e) {
+            queuePreferredHeightUpdate();
+        }, false); // load does not bubble
+
+        // Queues an update when a transition has completed, e.g. if the
+        // user resized the window
+        window.addEventListener("transitionend", function(e) {
+            queuePreferredHeightUpdate();
+        }, false); // load does not bubble
     },
     getPreferredHeight: function() {
         let html = window.document.documentElement;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]