B2G/gaia/apps/sms/js/thread_ui.js
// We define an edge for showing the following chunk of elements
We define an edge for showing the following chunk of elements
We define an edge for showing the following chunk of elements
function thui_manageScroll(oEvent) {
    var scrollTop = this.container.scrollTop;
    var scrollHeight = this.container.scrollHeight;
    var clientHeight = this.container.clientHeight;
    this.isScrolledManually = ((scrollTop + clientHeight) < scrollHeight);
    var kEdge = 30;
    if (scrollTop < kEdge) {
      this.showChunkOfMessages(this.CHUNK_SIZE);
      this.container.scrollTop =
        (this.container.scrollHeight - scrollHeight) + scrollTop;
    }
  }
function thui_manageScroll ( oEvent ) { var scrollTop = this . container . scrollTop ; var scrollHeight = this . container . scrollHeight ; var clientHeight = this . container . clientHeight ; this . isScrolledManually = ( ( scrollTop + clientHeight ) < scrollHeight ) ; var kEdge = 30 ; if ( scrollTop < kEdge ) { this . showChunkOfMessages ( this . CHUNK_SIZE ) ; this . container . scrollTop = ( this . container . scrollHeight - scrollHeight ) + scrollTop ; } }
We define an edge for showing the following chunk of elements
We define an edge for showing the following chunk of elements
// kEdge will be the limit (in pixels) for showing the next chunk // We update the scroll to the previous position // taking into account the previous offset to top // and the current height due to we have added a new // chunk of visible messages