summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/list.js14
1 files changed, 10 insertions, 4 deletions
diff --git a/program/js/list.js b/program/js/list.js
index b85ea61ca..0707172c4 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -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);
}
},