summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuelockwood <deathbearbrown@gmail.com>2013-10-23 11:21:11 -0400
committersuelockwood <deathbearbrown@gmail.com>2013-10-23 11:21:11 -0400
commit90b6db9f3a91929065a807dd377d0f01df0b47e9 (patch)
tree772db2c5dc8b2bc81cc73b0133ba2edf1d3ab176
parentcee22107146b68d14d233bb1b760777bce3ebb55 (diff)
downloadcouchdb-90b6db9f3a91929065a807dd377d0f01df0b47e9.tar.gz
Added form validation for when you make a view with a new design doc, so that you have to enter a design doc name
-rw-r--r--src/fauxton/app/modules/documents/views.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fauxton/app/modules/documents/views.js b/src/fauxton/app/modules/documents/views.js
index 512292125..283f7b9f2 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"
});