summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-02-18 15:53:22 +0100
committerPetr Vobornik <pvoborni@redhat.com>2013-03-18 14:33:39 +0100
commit44db916419e4c0358ef6892223edaf9eaa77f051 (patch)
tree978a7f77fd2ba63ee55e6d1d0e235f1d3fe66a0d
parenta8723bb33dac348b9691fe8874ba082cb6dd3926 (diff)
downloadfreeipa.git-44db916419e4c0358ef6892223edaf9eaa77f051.tar.gz
freeipa.git-44db916419e4c0358ef6892223edaf9eaa77f051.tar.xz
freeipa.git-44db916419e4c0358ef6892223edaf9eaa77f051.zip
Fix dirty state update of editable combobox
Editable combobox didn't update it's dirty state correctly. CB had it's own internal value changed event, which was incorrectly used. It was removed and widget's value_changed event was used instead.
-rw-r--r--install/ui/src/freeipa/field.js24
-rw-r--r--install/ui/src/freeipa/widget.js4
2 files changed, 3 insertions, 25 deletions
diff --git a/install/ui/src/freeipa/field.js b/install/ui/src/freeipa/field.js
index f6906d7d..c549a000 100644
--- a/install/ui/src/freeipa/field.js
+++ b/install/ui/src/freeipa/field.js
@@ -714,26 +714,6 @@ IPA.select_field = function(spec) {
return that;
};
-
-IPA.combobox_field = function(spec) {
-
- spec = spec || {};
-
- var that = IPA.field(spec);
-
- that.widgets_created = function() {
-
- that.field_widgets_created();
- that.widget.input_field_changed.attach(that.on_input_field_changed);
- };
-
- that.on_input_field_changed = function() {
- that.validate();
- };
-
- return that;
-};
-
IPA.link_field = function(spec) {
spec = spec || {};
@@ -935,9 +915,9 @@ IPA.field_builder = function(spec) {
IPA.field_factories['checkbox'] = IPA.checkbox_field;
IPA.field_factories['checkboxes'] = IPA.checkboxes_field;
-IPA.field_factories['combobox'] = IPA.combobox_field;
+IPA.field_factories['combobox'] = IPA.field;
IPA.field_factories['enable'] = IPA.enable_field;
-IPA.field_factories['entity_select'] = IPA.combobox_field;
+IPA.field_factories['entity_select'] = IPA.field;
IPA.field_factories['field'] = IPA.field;
IPA.field_factories['link'] = IPA.link_field;
IPA.field_factories['multivalued'] = IPA.multivalued_field;
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js
index b67d6776..6472cab9 100644
--- a/install/ui/src/freeipa/widget.js
+++ b/install/ui/src/freeipa/widget.js
@@ -2080,7 +2080,6 @@ IPA.combobox_widget = function(spec) {
that.size = spec.size || 5;
that.empty_option = spec.empty_option === undefined ? true : spec.empty_option;
that.options = spec.options || [];
- that.input_field_changed = IPA.observer();
that.z_index = spec.z_index ? spec.z_index + 9000000 : 9000000;
that.create = function(container) {
@@ -2237,7 +2236,6 @@ IPA.combobox_widget = function(spec) {
return false;
}
- that.input_field_changed.notify([], that);
return true;
};
@@ -2245,7 +2243,7 @@ IPA.combobox_widget = function(spec) {
if (!that.editable || that.read_only) {
e.preventDefault();
} else {
- that.input_field_changed.notify([], that);
+ that.value_changed.notify([], that);
}
};