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/details.js | 90 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 77 insertions(+), 13 deletions(-) (limited to 'install/ui/details.js') diff --git a/install/ui/details.js b/install/ui/details.js index f7831114..cecf97a6 100644 --- a/install/ui/details.js +++ b/install/ui/details.js @@ -43,17 +43,42 @@ IPA.details_section = function(spec) { that.dirty = false; that.dirty_changed = IPA.observer(); + that.undo = typeof spec.undo == 'undefined' ? true : spec.undo; + + var init = function() { + var fields = spec.fields || []; + that.add_fields(fields); + }; + that.get_field = function(name) { return that.fields.get(name); }; that.add_field = function(field) { field.entity = that.entity; + field.undo = that.undo; that.fields.put(field.name, field); field.dirty_changed.attach(that.field_dirty_changed); return field; }; + that.add_fields = function(fields) { + for (var i=0; i', { name: field.name, title: field.label, @@ -102,7 +129,6 @@ IPA.details_section = function(spec) { } }; - that.load = function(record) { that.record = record; @@ -114,6 +140,14 @@ IPA.details_section = function(spec) { } }; + that.save = function(record) { + var fields = that.fields.values; + for (var i=0; i