[polari] chatView: Fix condition for scrolling pending messages on screen



commit 4b551a5bcf99537e77b4acebd7a8d1fd3c69474b
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Nov 28 18:34:03 2013 +0000

    chatView: Fix condition for scrolling pending messages on screen
    
    Currently the first pending message is scrolled on screen for
    inactive rooms only, to avoid interfering with backlog reading.
    This is a rather poor solution though, as auto-scrolling is the
    desired behavior when not reading backlog. To fix, change the
    condition to test for the current scroll position instead, as we
    already do for non-highlighted messages.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712217

 src/chatView.js |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/chatView.js b/src/chatView.js
index fceb657..d1d2a3c 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -333,14 +333,15 @@ const ChatView = new Lang.Class({
 
     _updateScroll: function() {
         let adj = this.widget.vadjustment;
-        if (this._nPending == 0) {
-            if (adj.value == this._scrollBottom)
+        if (adj.value == this._scrollBottom) {
+            if (this._nPending == 0) {
                 adj.value = adj.upper - adj.page_size;
-        } else if (!this._active) {
-            let id = Object.keys(this._pending).sort(function(a, b) {
-                return a - b;
-            })[0];
-            this._view.scroll_mark_onscreen(this._pending[id]);
+            } else {
+                let id = Object.keys(this._pending).sort(function(a, b) {
+                    return a - b;
+                })[0];
+                this._view.scroll_mark_onscreen(this._pending[id]);
+            }
         }
         this._scrollBottom = adj.upper - adj.page_size;
     },


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