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 90b6db9
Date Wed, 23 Oct 2013 15:21:21 GMT
Updated Branches:
  refs/heads/master cee221071 -> 90b6db9f3


Added form validation for when you make a view with a new design doc,  so that you have to
enter a design doc name


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

Branch: refs/heads/master
Commit: 90b6db9f3a91929065a807dd377d0f01df0b47e9
Parents: cee2210
Author: suelockwood <deathbearbrown@gmail.com>
Authored: Wed Oct 23 11:21:11 2013 -0400
Committer: suelockwood <deathbearbrown@gmail.com>
Committed: Wed Oct 23 11:21:11 2013 -0400

----------------------------------------------------------------------
 src/fauxton/app/modules/documents/views.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/couchdb/blob/90b6db9f/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 5122921..283f7b9 100644
--- a/src/fauxton/app/modules/documents/views.js
+++ b/src/fauxton/app/modules/documents/views.js
@@ -1251,7 +1251,7 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror,
JSHint, re
 
       if (event) { event.preventDefault();}
 
-      if (this.hasValidCode()) {
+      if (this.hasValidCode() && this.$('#new-ddoc:visible').val() !=="") {
         var mapVal = this.mapEditor.getValue(), 
         reduceVal = this.reduceVal(),
         viewName = this.$('#index-name').val(),
@@ -1294,8 +1294,9 @@ function(app, FauxtonAPI, Components, Documents, pouchdb, Codemirror,
JSHint, re
           });
         });
       } else {
+        var errormessage = (this.$('#new-ddoc:visible').val() ==="")?"Enter a design doc
name":"Please fix the Javascript errors and try again.";
         notification = FauxtonAPI.addNotification({
-          msg: "Please fix the Javascript errors and try again.",
+          msg: errormessage,
           type: "error",
           selector: "#define-view .errors-container"
         });


Mime
View raw message