summaryrefslogtreecommitdiffstats
path: root/install/ui/dialog.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-10-25 18:41:45 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-10-27 13:48:51 +0000
commit7142cee430a194cca1208ce4ebcd70ee892af1b9 (patch)
treeb5850c550433b1105bb9fefcb46bb1d9011c8c6a /install/ui/dialog.js
parent725e2e46248ee9ab3dae9a523fcd6fda0bd0cff3 (diff)
downloadfreeipa.git-7142cee430a194cca1208ce4ebcd70ee892af1b9.tar.gz
freeipa.git-7142cee430a194cca1208ce4ebcd70ee892af1b9.tar.xz
freeipa.git-7142cee430a194cca1208ce4ebcd70ee892af1b9.zip
Refactored validation code.
The validation code in details facet, dialog, and sections have been modified to work more consistently.
Diffstat (limited to 'install/ui/dialog.js')
-rw-r--r--install/ui/dialog.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/install/ui/dialog.js b/install/ui/dialog.js
index 41b35fb4..ff64b37c 100644
--- a/install/ui/dialog.js
+++ b/install/ui/dialog.js
@@ -66,7 +66,6 @@ IPA.dialog = function(spec) {
that.height = spec.height;
that.buttons = $.ordered_map();
-
that.sections = $.ordered_map();
var init = function() {
@@ -129,12 +128,14 @@ IPA.dialog = function(spec) {
return that;
};
- that.is_valid = function() {
- for (var i=0; i<that.sections.length; i++) {
- var section = that.sections.values[i];
- if (!section.is_valid()) return false;
+ that.validate = function() {
+ var valid = true;
+ var sections = that.sections.values;
+ for (var i=0; i<sections.length; i++) {
+ var section = sections[i];
+ valid &= section.validate();
}
- return true;
+ return valid;
};
that.add_section = function(section) {