Make scrolling into the bufferlines div, not the whole window

This should improve scrolling experience, especially on webkit.
It also is needed for when nicklist will appear
with-route-provider
Tor Hveem 12 years ago
parent 5fb4ea2758
commit c9f7e9a732
  1. 12
      css/glowingbear.css
  2. 2
      index.html
  3. 7
      js/websockets.js

@ -174,16 +174,16 @@ input[type=text], input[type=password], .badge {
min-height: 100%;
}
.bufferlines {
#bufferlines {
font-family: 'Terminus', 'Inconsolata', 'Consolas', 'Monaco', 'Ubuntu Mono', monospace;
position: relative;
height: 99%;
overflow-y: auto;
margin-left: 14%;
width: auto;
position: relative;
padding-bottom: 60px; /* bottom input */
padding-top: 35px; /* topbar */
top: 25px; /* topbar */
}
.bufferlines .btn {
#bufferlines .btn {
font-family: sans-serif;
}
@ -191,7 +191,7 @@ input[type=text], input[type=password], .badge {
margin: 0 5px 0 14%;
}
@media (max-width: 968px) {
#sidebar, .bufferlines {
#sidebar, #bufferlines {
position: relative;
min-height: 0;
margin-left: 0;

@ -211,7 +211,7 @@
</li>
</ul>
</div>
<div class="bufferlines">
<div id="bufferlines">
<table>
<tbody>
<tr class="bufferline" ng-repeat-start="bufferline in activeBuffer().lines">

@ -427,10 +427,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout',
if(readmarker) {
readmarker.scrollIntoView();
}else{
var sTop = document.documentElement.scrollTop;
var sVal = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var bl = document.getElementById('bufferlines');
var sTop = bl.scrollTop;
var sVal = bl.scrollHeight - bl.clientHeight;
if(sTop < sVal) {
document.documentElement.scrollTop = sVal;
bl.scrollTop = sVal;
}
}
}

Loading…
Cancel
Save