couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From benk...@apache.org
Subject fauxton commit: updated refs/heads/master to 9d43717
Date Fri, 21 Nov 2014 02:00:56 GMT
Repository: couchdb-fauxton
Updated Branches:
  refs/heads/master d69b0edac -> 9d43717dc


Only render doc page breadcrumbs as needed

All routes changes used to cause the breadcrumbs to be re-rendered,
even though they often don't change. This small change checks to see
if the crumbs have in fact changed, and only re-renders if so.

Closes COUCHDB-2465


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

Branch: refs/heads/master
Commit: 9d43717dc52b4f7f42c0d0243a32dcbd568ca502
Parents: d69b0ed
Author: Benjamin Keen <ben.keen@gmail.com>
Authored: Mon Nov 17 15:52:32 2014 -0800
Committer: Benjamin Keen <ben.keen@gmail.com>
Committed: Thu Nov 20 18:00:38 2014 -0800

----------------------------------------------------------------------
 app/addons/fauxton/components.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb-fauxton/blob/9d43717d/app/addons/fauxton/components.js
----------------------------------------------------------------------
diff --git a/app/addons/fauxton/components.js b/app/addons/fauxton/components.js
index ed28b1e..c76fb9d 100644
--- a/app/addons/fauxton/components.js
+++ b/app/addons/fauxton/components.js
@@ -52,7 +52,13 @@ function(app, FauxtonAPI, ace, spin, ZeroClipboard) {
       this.listenTo(FauxtonAPI.Events, 'lookaheadTray:close', this.unselectLastBreadcrumb);
     },
 
-    updateCrumbs: function(crumbs){
+    updateCrumbs: function (crumbs) {
+
+      // if the breadcrumbs haven't changed, don't bother re-rendering the component
+      if (_.isEqual(this.crumbs, crumbs)) {
+        return;
+      }
+
       this.crumbs = crumbs;
       this.breadcrumbs && this.breadcrumbs.update(crumbs);
     },


Mime
View raw message