couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject couchdb commit: updated refs/heads/Query-UI-Cleanup to 199a54f
Date Wed, 16 Apr 2014 19:22:03 GMT
Repository: couchdb
Updated Branches:
  refs/heads/Query-UI-Cleanup 7a370261c -> 199a54f94


Untoggle Query Keys


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

Branch: refs/heads/Query-UI-Cleanup
Commit: 199a54f9444dd002566051c7ae75fc8f5748da22
Parents: 7a37026
Author: suelockwood <deathbear@apache.org>
Authored: Wed Apr 16 15:21:06 2014 -0400
Committer: suelockwood <deathbear@apache.org>
Committed: Wed Apr 16 15:21:53 2014 -0400

----------------------------------------------------------------------
 .../documents/templates/advanced_options.html   |  4 ++--
 src/fauxton/app/addons/documents/views.js       | 23 ++++++++++++--------
 2 files changed, 16 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/199a54f9/src/fauxton/app/addons/documents/templates/advanced_options.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/addons/documents/templates/advanced_options.html b/src/fauxton/app/addons/documents/templates/advanced_options.html
index aa2cdcf..095c24e 100644
--- a/src/fauxton/app/addons/documents/templates/advanced_options.html
+++ b/src/fauxton/app/addons/documents/templates/advanced_options.html
@@ -18,10 +18,10 @@ the License.
 
   <div class="btn-group toggle-btns">
     <label for="showKeys" class="drop-down btn">
-     Specific Key(s)
+     By Key(s)
     </label>
     <label for="showStartEnd" class="drop-down btn">
-      Bounded Queries
+      Between Keys
     </label>
   </div>
 

http://git-wip-us.apache.org/repos/asf/couchdb/blob/199a54f9/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 66aa74d..5b096bb 100644
--- a/src/fauxton/app/addons/documents/views.js
+++ b/src/fauxton/app/addons/documents/views.js
@@ -1059,16 +1059,21 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
 
     toggleQuery: function(e){
       e.preventDefault();
-      this.$('.js-query-keys-wrapper').removeClass("hide");
-      var showFunctionName =this.$(e.currentTarget).attr("for");
-      //highlight current
-      this.$(".toggle-btns > label").removeClass('active');
-      this.$(e.currentTarget).addClass("active");
 
-      this.$("[id^='js-show']").hide();
-
-      //show section & disable what needs to be disabled
-      this[showFunctionName]();
+      if (this.$(e.currentTarget).hasClass("active")){
+        this.$('.js-query-keys-wrapper').addClass("hide");
+        this.$(".toggle-btns > label").removeClass('active');
+        this.$('.js-query-keys-wrapper').find("input,textarea").attr("disabled","true");
+      } else {
+        this.$('.js-query-keys-wrapper').removeClass("hide");
+        var showFunctionName =this.$(e.currentTarget).attr("for");
+        //highlight current
+        this.$(".toggle-btns > label").removeClass('active');
+        this.$(e.currentTarget).addClass("active");
+        this.$("[id^='js-show']").hide();
+        //show section & disable what needs to be disabled
+        this[showFunctionName]();
+      }
     },
 
     showKeys: function(){


Mime
View raw message