diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-10-30 04:33:05 -0700 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-10-30 04:33:05 -0700 |
commit | 0c77475f3f27ca157251738ebaedb6f49d5ec30c (patch) | |
tree | e144501a363ac964eaa6848ca5007b25fe6a020e /program | |
parent | a630ba4e06a0a8d4bccdfc5873f039e0eb3bd26e (diff) | |
parent | 741f387c149a834397a42612bc31b27962d5caa0 (diff) |
Merge pull request #149 from cmcnulty/1489403
#1489403 - fixes scrolling issues when highlighted message is below header.
Diffstat (limited to 'program')
-rw-r--r-- | program/js/list.js | 14 |
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); } }, |