couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From deathb...@apache.org
Subject git commit: updated refs/heads/master to 2996574
Date Thu, 19 Dec 2013 15:39:28 GMT
Updated Branches:
  refs/heads/master 35968da54 -> 299657473


Fix for issue: Search for Document with name that doesn't exist leads to unworkable state
Turned it into a form. Added validation


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

Branch: refs/heads/master
Commit: 299657473f0f0aea3314183f87fe7921bdd29c75
Parents: 35968da
Author: suelockwood <deathbear@apache.org>
Authored: Thu Dec 19 10:38:25 2013 -0500
Committer: suelockwood <deathbear@apache.org>
Committed: Thu Dec 19 10:38:25 2013 -0500

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js       | 14 ++++++++++----
 src/fauxton/app/templates/documents/jumpdoc.html |  8 ++++----
 src/fauxton/assets/less/fauxton.less             | 15 ++++-----------
 3 files changed, 18 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/29965747/src/fauxton/app/modules/documents/views.js
----------------------------------------------------------------------
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index faf3539..44cf484 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1602,16 +1602,22 @@ function(app, FauxtonAPI, Components, Documents, Databases, pouchdb,
resizeColum
     },
 
     events: {
-      "submit #jump-to-doc": "jumpToDoc",
-      "click #jump-to-doc-label": "jumpToDoc"
+      "submit #jump-to-doc": "jumpToDoc"
     },
 
     jumpToDoc: function (event) {
       event.preventDefault();
 
-      var docId = this.$('#jump-to-doc-id').val();
+      var docId = this.$('#jump-to-doc-id').val().trim();
 
-      FauxtonAPI.navigate('/database/' + this.database.id +'/' + docId, {trigger: true});
+      if (this.database.allDocs.where({"_id":docId}).length > 0){
+        FauxtonAPI.navigate('/database/' + this.database.id +'/' + docId, {trigger: true});
+      } else {
+        FauxtonAPI.addNotification({
+          msg: 'Document ID does not exist.',
+          type: 'error'
+        });
+      }
     },
 
     afterRender: function () {

http://git-wip-us.apache.org/repos/asf/couchdb/blob/29965747/src/fauxton/app/templates/documents/jumpdoc.html
----------------------------------------------------------------------
diff --git a/src/fauxton/app/templates/documents/jumpdoc.html b/src/fauxton/app/templates/documents/jumpdoc.html
index c6f4652..43fdb9c 100644
--- a/src/fauxton/app/templates/documents/jumpdoc.html
+++ b/src/fauxton/app/templates/documents/jumpdoc.html
@@ -12,8 +12,8 @@ License for the specific language governing permissions and limitations
under
 the License.
 -->
 
-<form id="jump-to-doc" class="form-inline" >
-  <label id="jump-to-doc-label" class="fonticon-search">
-    <input type="text" id="jump-to-doc-id" class="input-large" placeholder="Document ID"></input>
-  </label>
+<form id="jump-to-doc" class="form-inline input-append" >
+  <input type="text" id="jump-to-doc-id" class="input-large" placeholder="Document ID"></input>
+
+  <button class="fonticon-search btn button red " type="submit"></button>
 </form>

http://git-wip-us.apache.org/repos/asf/couchdb/blob/29965747/src/fauxton/assets/less/fauxton.less
----------------------------------------------------------------------
diff --git a/src/fauxton/assets/less/fauxton.less b/src/fauxton/assets/less/fauxton.less
index b94ba39..0cf7bc2 100644
--- a/src/fauxton/assets/less/fauxton.less
+++ b/src/fauxton/assets/less/fauxton.less
@@ -975,18 +975,11 @@ div.spinner {
 }
 
 #jump-to-doc {
-  width: 50%;
-  max-width: 600px;
+  width: auto;
   float:right;
-  margin-right: 40px;
-
-  #jump-to-doc-label {
-    width: 100%;
-  }
-
-  #jump-to-doc-id {
-    width: 100%;
-    margin-top: -4px;
+  button{
+    padding-left: 20px;
+    padding-right: 10px;
   }
 }
 


Mime
View raw message