summaryrefslogtreecommitdiffstats
path: root/install/ui/details.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-02-02 16:18:35 -0600
committerAdam Young <ayoung@redhat.com>2011-02-03 20:09:15 -0500
commitbd493d47a736fab4e74efbe9b603dcc8f1986512 (patch)
tree00f21fb46a747c8ef3219773b2d669c9b1d76f7f /install/ui/details.js
parentff646ec3a428647cac8fa9304a5695c7f29456a2 (diff)
downloadfreeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.tar.gz
freeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.tar.xz
freeipa-bd493d47a736fab4e74efbe9b603dcc8f1986512.zip
Added multi-valued text widget.
A multi-valued text widget has been created to replace the old IPA.details_field. The old code was designed to handle all data types, and it uses one <dd> tag for each value, so the code is still incomplete and complex. The new code was designed to handle only multi-valued text attributes, and it uses one <dd> tag for all values, so it's easier to maintain. There are already other widgets that can be used to handle other data types. The new code supports line-level undo and line-out for removal like the old code, but there are some changes: - Undoing a newly added line will remove the entire line. - Editing the value of a removed line will cancel the removal. - It provides 'undo all' link to reset the entire attribute. The old code will be cleaned up in a subsequent patch.
Diffstat (limited to 'install/ui/details.js')
-rw-r--r--install/ui/details.js15
1 files changed, 9 insertions, 6 deletions
diff --git a/install/ui/details.js b/install/ui/details.js
index 125ef1bc8..5872e81cf 100644
--- a/install/ui/details.js
+++ b/install/ui/details.js
@@ -333,6 +333,12 @@ IPA.details_section = function (spec){
return that;
};
+ that.multivalued_text = function(spec) {
+ var field = IPA.multivalued_text_widget(spec);
+ that.add_field(field);
+ return that;
+ };
+
that.create_field = function(spec) {
//TODO: replace IPA.details_field with class-specific implementation
@@ -510,17 +516,14 @@ IPA.details_list_section = function (spec){
for (var i = 0; i < fields.length; ++i) {
var field = fields[i];
- var label = field.label;
+ var label = field.label || '';
// no need to get i18n label from metadata
// because it's already done by field.init()
- if (label !== '') {
- label += ':';
- }
-
$('<dt/>', {
- html: label
+ html: label+':',
+ title: label
}).appendTo(dl);
var span = $('<span/>', { 'name': field.name }).appendTo(dl);