Fix rownum determination when rownum is originally not in buffer
authorMichael M Slusarz <slusarz@curecanti.org>
Tue, 22 Dec 2009 05:25:30 +0000 (22:25 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Tue, 22 Dec 2009 05:30:13 +0000 (22:30 -0700)
imp/js/DimpBase.js

index 0487e5b..12301bf 100644 (file)
@@ -497,13 +497,15 @@ var DimpBase = {
                     var row = this.viewport.getSelection().search({ imapuid: { equal: [ this.uid ] }, view: { equal: [ this.folder ] } });
                     if (row.size()) {
                         this.rownum = row.get('rownum').first();
-                        this.viewport.scrollTo(this.rownum, { noupdate: true, top: true });
-                        offset = this.viewport.currentOffset();
                     }
                     this.uid = null;
-                } else if (this.rownum) {
-                    offset = this.rownum - 1;
                 }
+
+                if (this.rownum) {
+                    this.viewport.scrollTo(this.rownum, { noupdate: true, top: true });
+                    offset = this.viewport.currentOffset();
+                }
+
                 return offset;
             }.bind(this),
             onSlide: this.setMessageListTitle.bind(this)