From: Michael M Slusarz Date: Mon, 12 Oct 2009 16:59:24 +0000 (-0600) Subject: Save viewport position if loading in background. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c676300f4b6536b7b784575883a05360b4ca6abd;p=horde.git Save viewport position if loading in background. This would manifest itself when background loading the INBOX on login. If the first viewable message was not in the base slice, the viewport would not be positioned correctly when eventually viewed. --- diff --git a/imp/js/ViewPort.js b/imp/js/ViewPort.js index c48a94182..762db06cc 100644 --- a/imp/js/ViewPort.js +++ b/imp/js/ViewPort.js @@ -702,6 +702,11 @@ var ViewPort = Class.create({ // TODO: Flag for no _fetchBuffer()? if (this.view == r.view) { this._updateContent(Object.isUndefined(offset) ? (r.rownum ? Number(r.rownum) - 1 : this.currentOffset()) : offset); + } else if (r.rownum) { + // We loaded in the background. If rownumber information was + // provided, we need to save this or else we will position the + // viewport incorrectly. + buffer.setMetaData({ offset: Number(r.rownum) - 1 }, true); } this.isbusy = false;