Merge onComplete() and onContentComplete().
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Apr 2009 23:17:49 +0000 (17:17 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 6 Apr 2009 23:17:49 +0000 (17:17 -0600)
imp/js/src/DimpBase.js
imp/js/src/ViewPort.js

index ab7505e..9439124 100644 (file)
@@ -465,6 +465,9 @@ var DimpBase = {
                 }
             }.bind(this),
             onContentComplete: function(rows) {
+                var row, ssc, tmp,
+                    l = this.viewport.getMetaData('label');
+
                 rows.each(function(row) {
                     // Add context menu
                     this._addMouseEvents({ id: row.domid, type: row.menutype });
@@ -472,10 +475,6 @@ var DimpBase = {
                 }, this);
 
                 this.setMessageListTitle();
-            }.bind(this),
-            onComplete: function() {
-                var row, ssc, tmp,
-                    l = this.viewport.getMetaData('label');
 
                 if (this.uid) {
                     row = this.viewport.getViewportSelection().search({ imapuid: { equal: [ this.uid ] }, view: { equal: [ this.folder ] } });
index 63ba2f3..3459246 100644 (file)
@@ -85,9 +85,6 @@ var ViewPort = Class.create({
         if (curr) {
             this._updateContent(curr.offset, opts);
             if (!background) {
-                if (this.opts.onComplete) {
-                    this.opts.onComplete();
-                }
                 this.opts.ajaxRequest(this.opts.fetch_action, this.addRequestParams({ checkcache: 1, rownum: this.currentOffset() + 1 }));
             }
             return true;
@@ -604,10 +601,6 @@ var ViewPort = Class.create({
                 !this._updateContent((cr_id && cr_id.offset) ? cr_id.offset : (r.rownum ? parseInt(r.rownum) - 1 : this.currentOffset()))) {
                 return;
             }
-
-            if (this.opts.onComplete) {
-                this.opts.onComplete();
-            }
         }
 
         if (this.opts.onEndFetch) {