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
This commit is contained in:
Tor Hveem 2013-10-25 22:19:23 +02:00
parent 5fb4ea2758
commit c9f7e9a732
3 changed files with 11 additions and 10 deletions

View file

@ -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;

View file

@ -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">

View file

@ -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;
}
}
}