summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2011-07-08 10:15:16 -0400
committerEndi S. Dewata <edewata@redhat.com>2011-07-08 17:34:55 +0000
commit30492ef3faad5eabeb91930795fbfd413a732932 (patch)
treeccca73dd98ee11a7c38089a6684173651fb3ac14
parent2337fb57601a29e41d9a94ed161104740cd8027c (diff)
downloadfreeipa-30492ef3faad5eabeb91930795fbfd413a732932.zip
freeipa-30492ef3faad5eabeb91930795fbfd413a732932.tar.gz
freeipa-30492ef3faad5eabeb91930795fbfd413a732932.tar.xz
clear errors on reset
https://fedorahosted.org/freeipa/ticket/1446
-rw-r--r--install/ui/details.js2
-rw-r--r--install/ui/test/details_tests.js2
-rw-r--r--install/ui/widget.js10
3 files changed, 10 insertions, 4 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index 6a2def7..7467697 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -155,7 +155,6 @@ IPA.details_section = function(spec) {
for (var j=0; j<fields.length; j++) {
var field = fields[j];
- var span = $('span[name='+field.name+']', this.container).first();
field.load(record);
}
};
@@ -164,7 +163,6 @@ IPA.details_section = function(spec) {
var fields = that.fields.values;
for (var i=0; i<fields.length; i++) {
var field = fields[i];
- var span = $('span[name='+field.name+']', this.container).first();
field.reset();
}
};
diff --git a/install/ui/test/details_tests.js b/install/ui/test/details_tests.js
index 71e6bf9..1b19f4b 100644
--- a/install/ui/test/details_tests.js
+++ b/install/ui/test/details_tests.js
@@ -170,7 +170,7 @@ test("Testing details lifecycle: create, setup, load.", function(){
widget.save = function() {
save_called = true;
- widget.widget_save();
+ return widget.widget_save();
};
return widget;
}
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 0ec9a96..5eb58f6 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -140,6 +140,12 @@ IPA.widget = function(spec) {
that.valid = true;
var values = that.save();
+ if (!values){
+ return;
+ }
+ if (values.length ===0 ){
+ return;
+ }
var value = values[0];
if (!value) {
return;
@@ -264,6 +270,7 @@ IPA.widget = function(spec) {
that.reset = function() {
that.update();
+ that.validate();
that.set_dirty(false);
};
@@ -1704,11 +1711,12 @@ IPA.entity_select_widget = function(spec) {
that.reset = function() {
that.entity_filter.val(that.values[0]);
- that.set_dirty(false);
populate_select(that.values[0]);
if (editable){
that.edit_box.val(that.values[0]);
}
+ that.validate();
+ that.set_dirty(false);
};
that.load = function(record) {