Fix viewport update of thread messages after delete.
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Dec 2010 04:25:43 +0000 (21:25 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 1 Dec 2010 04:25:43 +0000 (21:25 -0700)
imp/js/viewport.js

index 3f117e9..7f31d77 100644 (file)
@@ -480,7 +480,7 @@ var ViewPort = Class.create({
         }
 
         if (this.view && sp.curr != this.pane_mode) {
-            c_opts.updated = this.createSelection('div', this.visibleRows()).get('domid');
+            c_opts.updated = true;
         }
 
         // Get split pane dimensions
@@ -843,8 +843,7 @@ var ViewPort = Class.create({
 
         var callback, offset, tmp,
             buffer = this._getBuffer(r.view),
-            llist = buffer.getMetaData('llist') || $H(),
-            updated = [];
+            llist = buffer.getMetaData('llist') || $H();
 
         buffer.update(Object.isArray(r.data) ? {} : r.data, Object.isArray(r.rowlist) ? {} : r.rowlist, r.metadata || {}, { reset: r.reset, resetmd: r.resetmd, update: r.update });
 
@@ -886,10 +885,7 @@ var ViewPort = Class.create({
         }
 
         if (this.view == r.view) {
-            if (r.update) {
-                updated = this.createSelection('uid', Object.keys(r.data)).get('domid');
-            }
-            this._updateContent(Object.isUndefined(r.rownum) ? (Object.isUndefined(offset) ? this.currentOffset() : offset) : Number(r.rownum) - 1, { updated: updated });
+            this._updateContent(Object.isUndefined(r.rownum) ? (Object.isUndefined(offset) ? this.currentOffset() : offset) : Number(r.rownum) - 1, { updated: r.update });
         } 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
@@ -916,7 +912,6 @@ var ViewPort = Class.create({
             c = this.opts.content,
             page_size = this.getPageSize(),
             tmp = [],
-            updated = opts.updated || [],
             vr = this.visibleRows(),
             fdiv, rows;
 
@@ -935,8 +930,7 @@ var ViewPort = Class.create({
 
             rows.get('dataob').each(function(r) {
                 var elt;
-                if (!updated.include(r.VP_domid) &&
-                    (elt = $(r.VP_domid))) {
+                if (!opts.updated && (elt = $(r.VP_domid))) {
                     tmp.push(elt);
                 } else {
                     fdiv.insert({ top: this.prepareRow(r) });