From c676300f4b6536b7b784575883a05360b4ca6abd Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Mon, 12 Oct 2009 10:59:24 -0600 Subject: [PATCH] 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. --- imp/js/ViewPort.js | 5 +++++ 1 file changed, 5 insertions(+) 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; -- 2.11.0