cmcnulty
2013-10-29 741f387c149a834397a42612bc31b27962d5caa0
fix scrolling up

Make sure that the fixed header is never over a message
1 files modified
14 ■■■■ changed files
program/js/list.js 14 ●●●● patch | view | raw | blame | history
program/js/list.js
@@ -1245,7 +1245,8 @@
{
  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) {
@@ -1254,9 +1255,14 @@
      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);
  }
},