first try instant scrolling, then delayed

with-route-provider
Tor Hveem 12 years ago
parent 96a96af7c8
commit f5088d54b0
  1. 6
      js/websockets.js

@ -342,14 +342,16 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
$rootScope.scrollToBottom = function() {
// FIXME doesn't work if the settimeout runs without a short delay
// 300 ms seems to do the trick but creates a noticable flickr
$timeout(function() {
var scroll = function() {
var readmarker = document.getElementById('readmarker');
if(readmarker) {
readmarker.scrollIntoView();
}else{
window.scroll(0, document.documentElement.scrollHeight - document.documentElement.clientHeight);
}
}, 300);
}
scroll();
$timeout(scroll, 300);
}
$scope.sendMessage = function() {

Loading…
Cancel
Save