couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gar...@apache.org
Subject couchdb commit: updated refs/heads/master to ce91d81
Date Mon, 10 Mar 2014 20:05:24 GMT
Repository: couchdb
Updated Branches:
  refs/heads/master 023da37ca -> ce91d81bb


Set the triggering of the call to poll or stop polling ddoc metadata in the tab toggling


Project: http://git-wip-us.apache.org/repos/asf/couchdb/repo
Commit: http://git-wip-us.apache.org/repos/asf/couchdb/commit/ce91d81b
Tree: http://git-wip-us.apache.org/repos/asf/couchdb/tree/ce91d81b
Diff: http://git-wip-us.apache.org/repos/asf/couchdb/diff/ce91d81b

Branch: refs/heads/master
Commit: ce91d81bb71fff5ac4e89e38e372822204ac717e
Parents: 023da37
Author: suelockwood <deathbear@apache.org>
Authored: Mon Mar 10 13:08:43 2014 -0400
Committer: Garren Smith <garren.smith@gmail.com>
Committed: Mon Mar 10 16:04:25 2014 -0400

----------------------------------------------------------------------
 src/fauxton/app/addons/documents/views.js | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/ce91d81b/src/fauxton/app/addons/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/views.js b/src/fauxton/app/addons/documents/views.js
index 54ec261..b51ea08 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1577,6 +1577,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       if ($targetTab.attr('id') !== $previousTab.attr('id')) {
         $previousTab.removeAttr('style');
       }
+      //stop polling
+      this.ddocInfoView.stopRefreshInterval(); 
 
       if ($targetId === 'index-nav') {
         if (this.newView) { return; }
@@ -1585,6 +1587,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         $targetTab.toggle('slow', function(){
            that.showEditors();
         });
+      } else if ($targetId === "meta-nav"){
+        if ($previousTab.attr('id') !== "metadata"){
+          this.ddocInfoView.startRefreshInterval();
+        } 
+        $targetTab.toggle('slow'); 
       } else {
         $targetTab.toggle('slow');
       }
@@ -1628,7 +1635,14 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         $('.beautify-tooltip').tooltip();
       }
     },
+    renderDdocInfo: function(){
+      if(this.ddocInfoView){
+        this.ddocInfoView.remove();
+      } 
+      this.ddocInfoView = this.setView('#ddoc-info', new Views.DdocInfo({model: this.ddocInfo
}));
+      this.ddocInfoView.render();
 
+    },
     beforeRender: function () {
 
       if (this.newView) {
@@ -1643,7 +1657,7 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
         var ddocDecode = decodeURIComponent(this.ddocID);
         this.model = this.ddocs.get(ddocDecode).dDocModel();
         this.reduceFunStr = this.model.viewHasReduce(this.viewName);
-        this.setView('#ddoc-info', new Views.DdocInfo({model: this.ddocInfo }));
+        
       }
 
       this.designDocSelector = this.setView('.design-doc-group', new Views.DesignDocSelector({
@@ -1670,6 +1684,8 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
     },
 
     afterRender: function() {
+      this.renderDdocInfo();
+
       if (this.params && !this.newView) {
         this.advancedOptions.updateFromParams(this.params);
       }
@@ -1872,15 +1888,11 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
       };
     },
 
-    afterRender: function () {
-      this.startRefreshInterval();
-    },
-
     startRefreshInterval: function () {
       var model = this.model;
 
       // Interval already set
-      if (this.intervalId) { return ; }
+      if (this.intervalId) { this.stopRefreshInterval(); }
 
       this.intervalId = setInterval(function () {
         model.fetch();


Mime
View raw message