From ca59f3c365a07605cfcdfcf1375440483a73d442 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 31 Oct 2013 20:03:42 +0100 Subject: Fluid layout in DNS Zone adder dialog https://fedorahosted.org/freeipa/ticket/3904 --- install/ui/src/freeipa/dns.js | 104 +++++++++--------------------------------- 1 file changed, 21 insertions(+), 83 deletions(-) (limited to 'install/ui') 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 = $('
', { - style: 'display: none', - 'class': 'dialog-message ui-state-highlight ui-corner-all' - }).appendTo(that.container); - - var table = $('', { - 'class': 'section-table' - }).appendTo(that.container); - - var idnsname = that.widgets.get_widget('idnsname'); - - var tr = $('').appendTo(table); - - var td = $('').appendTo(table); - - td = $('
', { - 'class': 'section-cell-label', - title: idnsname.label - }).appendTo(tr); - - idnsname.create_radio(td); - - var label = $('', { - 'class': 'section-cell-field', - title: idnsname.label - }).appendTo(tr); + that.create_label = function(widget) { - var widget_cont = $('
', { - name: 'idnsname', - 'class': 'field' - }).appendTo(td); + var label_text = widget.label + that.get_measurement_unit_text(widget); - idnsname.create(widget_cont); + var label_cont = $('
', { '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 = $('
', { - 'class': 'section-cell-label', - title: name_from_ip.label - }).appendTo(tr); - - name_from_ip.create_radio(td); - - label = $('', { - 'class': 'section-cell-field', - title: name_from_ip.label - }).appendTo(tr); - - widget_cont = $('
', { - name: 'name_from_ip', - 'class': 'field' - }).appendTo(td); - - name_from_ip.create(widget_cont); - - idnsname.radio.click(); + $('