summaryrefslogtreecommitdiffstats
path: root/install/ui
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-08-26 14:27:48 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-08-30 14:51:38 +0000
commit7aaadf74f18f954ce455fdc4fdaa0c95070ab149 (patch)
treedffc06b3d35fa1c12437770bc6cf444be2b59cb8 /install/ui
parent4cd65a1d6e432945ae3c86a49ebc236d845d9cbd (diff)
downloadfreeipa-7aaadf74f18f954ce455fdc4fdaa0c95070ab149.tar.gz
freeipa-7aaadf74f18f954ce455fdc4fdaa0c95070ab149.tar.xz
freeipa-7aaadf74f18f954ce455fdc4fdaa0c95070ab149.zip
Fixed host adder dialog to show default DNS zone.
The DNS zone widget for host adder dialog has been modified not to provide an empty option, so it will show the first available zone. Ticket #1685
Diffstat (limited to 'install/ui')
-rw-r--r--install/ui/host.js1
-rw-r--r--install/ui/widget.js17
2 files changed, 14 insertions, 4 deletions
diff --git a/install/ui/host.js b/install/ui/host.js
index d22f54887..019d3f40d 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -136,6 +136,7 @@ IPA.entity_factories.host = function () {
name: 'dnszone',
label: IPA.metadata.objects.dnszone.label_singular,
editable: true,
+ empty_option: false,
undo: false
},
{
diff --git a/install/ui/widget.js b/install/ui/widget.js
index 83cb4dcb2..f3559a35b 100644
--- a/install/ui/widget.js
+++ b/install/ui/widget.js
@@ -1606,6 +1606,7 @@ IPA.combobox_widget = function(spec) {
that.editable = spec.editable;
that.searchable = spec.searchable;
that.list_size = spec.list_size || 5;
+ that.empty_option = spec.empty_option === undefined ? true : spec.empty_option;
that.create = function(container) {
that.widget_create(container);
@@ -1800,7 +1801,11 @@ IPA.entity_select_widget = function(spec) {
that.remove_options();
- that.create_option();
+ var selected_option = null;
+
+ if (that.empty_option) {
+ selected_option = that.create_option();
+ }
var filter = that.filter.val();
var entries = data.result.result;
@@ -1811,12 +1816,16 @@ IPA.entity_select_widget = function(spec) {
var option = that.create_option(value, value);
- if (filter === value) {
- option.attr('selected', 'selected');
+ if (!selected_option || filter === value) {
+ selected_option = option;
}
}
- that.set_dirty(that.test_dirty());
+ if (selected_option) {
+ selected_option.attr('selected', 'selected');
+ that.input.val(selected_option.val());
+ that.set_dirty(that.test_dirty());
+ }
};
command.execute();