]> jfr.im git - irc/quakenet/qwebirc.git/commitdiff
Fixes issue 38 (autoscroll breaks on lines that display a horizontal scrollbar).
authorChris Porter <redacted>
Sun, 26 Jul 2009 00:09:14 +0000 (01:09 +0100)
committerChris Porter <redacted>
Sun, 26 Jul 2009 00:09:14 +0000 (01:09 +0100)
js/ui/baseuiwindow.js

index 0307f1252c4e2fc5b11b4e02779b860eed76a699..8c2f73c5d392944184d952220858f16b1e8109be 100644 (file)
@@ -148,13 +148,16 @@ qwebirc.ui.Window = new Class({
     
     var prev = parent.getScroll();
     var prevbottom = parent.getScrollSize().y;
-    var prevsize = parent.getSize();
-    
-    /* fixes an IE bug */
-    if(prevbottom < prevsize.y)
-      prevbottom = prevsize.y;
+    var prevheight = parent.clientHeight;
+
+    /*
+     * fixes an IE bug: the scrollheight is less than the actual height
+     * when the div isn't full
+     */
+    if(prevbottom < prevheight)
+      prevbottom = prevheight;
       
-    return prev.y + prevsize.y == prevbottom;
+    return prev.y + prevheight == prevbottom;
   },
   getScrollParent: function() {
     var scrollparent = this.lines;