From 390d017e321fd5ed56af094cf1f1c74f64e95735 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Sat, 10 Sep 2011 11:54:02 -0500 Subject: Modified dialog to use sections. The IPA.dialog has been modified to store sections instead of fields. If there is no sections specified, it will create a default section. The adder dialog for automount map has been modified such that the fields related to indirect map are stored in a section which will only be visible when the map type is set to indirect. The adder dialog for host has been modified such that it uses a custom section for hostname and DNS zone and standard section for the other fields. Ticket #1394 --- install/ui/dialog.js | 211 ++++++++++++++++----------------------------------- 1 file changed, 65 insertions(+), 146 deletions(-) (limited to 'install/ui/dialog.js') diff --git a/install/ui/dialog.js b/install/ui/dialog.js index eb1bbd1d..e533e4af 100644 --- a/install/ui/dialog.js +++ b/install/ui/dialog.js @@ -39,32 +39,22 @@ IPA.dialog = function(spec) { that.buttons = {}; - that.fields = $.ordered_map(); that.sections = $.ordered_map(); - that.conditional_fields = []; + var init = function() { + + var sections = spec.sections || []; - that.enable_conditional_fields = function(){ - for (var i =0; i < that.conditional_fields.length; i+=1) { - $('label[id='+ - that.conditional_fields[i] +'-label]', - that.container).css('visibility','visible'); - $('input[name='+ - that.conditional_fields[i] + - ']',that.container).css('visibility','visible'); + for (var i=0; i', { - 'class': 'section-table' - }).appendTo(that.container); + if (name) { + return that.sections.get(name); - var fields = that.fields.values; - for (var i=0; i').appendTo(table); - - var td = $('', { - 'class': 'section-cell-label' - }).appendTo(tr); - - $('