summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2013-10-31 20:03:42 +0100
committerMartin Kosek <mkosek@redhat.com>2014-01-21 12:04:03 +0100
commitca59f3c365a07605cfcdfcf1375440483a73d442 (patch)
tree4dde0855431ed2fecd5596c93c6b3dd2b1c3202c
parent31926b2fe46dcbe24f02d6a12e855b009cc45243 (diff)
downloadfreeipa-ca59f3c365a07605cfcdfcf1375440483a73d442.tar.gz
freeipa-ca59f3c365a07605cfcdfcf1375440483a73d442.tar.xz
freeipa-ca59f3c365a07605cfcdfcf1375440483a73d442.zip
Fluid layout in DNS Zone adder dialog
https://fedorahosted.org/freeipa/ticket/3904
-rw-r--r--install/ui/src/freeipa/dns.js104
1 files changed, 21 insertions, 83 deletions
diff --git a/install/ui/src/freeipa/dns.js b/install/ui/src/freeipa/dns.js
index 1d740aaa4..b2eeb7896 100644
--- a/install/ui/src/freeipa/dns.js
+++ b/install/ui/src/freeipa/dns.js
@@ -277,8 +277,8 @@ return {
height: 300,
sections: [
{
- $factory: IPA.dnszone_name_section,
name: 'name',
+ layout: IPA.dnszone_name_section_layout,
fields: [
{
$type: 'dnszone_name',
@@ -401,95 +401,26 @@ IPA.dnszone_details_facet = function(spec, no_init) {
return that;
};
-IPA.dnszone_name_section = function(spec) {
+IPA.dnszone_name_section_layout = function(spec) {
- spec = spec || {};
-
- var that = IPA.details_table_section(spec);
-
- that.create = function(container) {
- that.container = container;
-
- that.message_container = $('<div/>', {
- style: 'display: none',
- 'class': 'dialog-message ui-state-highlight ui-corner-all'
- }).appendTo(that.container);
-
- var table = $('<table/>', {
- 'class': 'section-table'
- }).appendTo(that.container);
-
- var idnsname = that.widgets.get_widget('idnsname');
-
- var tr = $('<tr/>').appendTo(table);
-
- var td = $('<td/>', {
- 'class': 'section-cell-label',
- title: idnsname.label
- }).appendTo(tr);
-
- idnsname.create_radio(td);
-
- var label = $('<label/>', {
- name: 'idnsname',
- 'class': 'field-label',
- 'for': idnsname.radio_id
- }).appendTo(td);
-
-
-
- label.append(idnsname.label+':');
+ var that = IPA.fluid_layout(spec);
- idnsname.create_required(td);
+ that.radio_names = spec.radio_names || 'idnsname_method';
- td = $('<td/>', {
- 'class': 'section-cell-field',
- title: idnsname.label
- }).appendTo(tr);
+ that.create_label = function(widget) {
- var widget_cont = $('<div/>', {
- name: 'idnsname',
- 'class': 'field'
- }).appendTo(td);
+ var label_text = widget.label + that.get_measurement_unit_text(widget);
- idnsname.create(widget_cont);
+ var label_cont = $('<div/>', { 'class': 'control-label' });
- var idnsname_input = $('input', widget_cont);
+ widget.create_radio(label_cont);
- var name_from_ip = that.widgets.get_widget('name_from_ip');
-
- tr = $('<tr/>').appendTo(table);
-
- td = $('<td/>', {
- 'class': 'section-cell-label',
- title: name_from_ip.label
- }).appendTo(tr);
-
- name_from_ip.create_radio(td);
-
- label = $('<label/>', {
- name: 'name_from_ip',
- 'class': 'field-label',
- 'for': name_from_ip.radio_id
- }).appendTo(td);
-
- label.append(name_from_ip.label+':');
-
- name_from_ip.create_required(td);
-
- td = $('<td/>', {
- 'class': 'section-cell-field',
- title: name_from_ip.label
- }).appendTo(tr);
-
- widget_cont = $('<div/>', {
- name: 'name_from_ip',
- 'class': 'field'
- }).appendTo(td);
-
- name_from_ip.create(widget_cont);
-
- idnsname.radio.click();
+ $('<label/>', {
+ name: widget.name,
+ 'for': widget.radio_id,
+ text: label_text
+ }).appendTo(label_cont);
+ return label_cont;
};
@@ -528,6 +459,13 @@ IPA.add_dns_zone_name_policy = function() {
});
};
+ that.post_create = function() {
+
+ var idnsname_w = this.container.widgets.get_widget('name.idnsname');
+ idnsname_w.radio.prop('checked', true);
+ idnsname_w.radio_clicked.notify([], idnsname_w);
+ };
+
return that;
};