Merge pull request #149 from cmcnulty/1489403

#1489403 - fixes scrolling issues when highlighted message is below header.
pull/152/head
Aleksander Machniak 11 years ago
commit 0c77475f3f

@ -1233,7 +1233,8 @@ scrollto: function(id)
{
var row = this.rows[id].obj;
if (row && this.frame) {
var scroll_to = Number(row.offsetTop);
var scroll_to = Number(row.offsetTop),
head_offset = 0;
// expand thread if target row is hidden (collapsed)
if (!scroll_to && this.rows[id].parent_uid) {
@ -1242,9 +1243,14 @@ scrollto: function(id)
scroll_to = Number(row.offsetTop);
}
if (scroll_to < Number(this.frame.scrollTop))
this.frame.scrollTop = scroll_to;
else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
if(this.fixed_header)
head_offset = Number(this.thead.offsetHeight);
// if row is above the frame (or behind header)
if (scroll_to < Number(this.frame.scrollTop) + head_offset) {
// scroll window so that row isn't behind header
this.frame.scrollTop = scroll_to - head_offset;
} else if (scroll_to + Number(row.offsetHeight) > Number(this.frame.scrollTop) + Number(this.frame.offsetHeight))
this.frame.scrollTop = (scroll_to + Number(row.offsetHeight)) - Number(this.frame.offsetHeight);
}
},

Loading…
Cancel
Save