From e96ae165b25bdb23d04f6b053680f77135f13bb8 Mon Sep 17 00:00:00 2001 From: Tor Hveem Date: Wed, 5 Feb 2014 11:19:54 +0100 Subject: [PATCH] Fix a scrolling bug with chrome --- js/websockets.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/js/websockets.js b/js/websockets.js index 9a4a76a..11fb63e 100644 --- a/js/websockets.js +++ b/js/websockets.js @@ -604,7 +604,9 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', var scroll = function() { var sTop = bl.scrollTop; // Determine if we want to scroll at all - if (nonIncremental && sTop < sVal || sTop == sVal) { + // Give the check 3 pixels of slack so you don't have to hit + // the exact spot. This fixes a bug in some browsers + if (nonIncremental && sTop < sVal || (sTop - sVal < 3)) { var readmarker = document.getElementById('readmarker'); if(nonIncremental && readmarker) { // Switching channels, scroll to read marker