From d389e054f6173194daabc08ad3abd366005048bd Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Wed, 2 Feb 2011 10:35:23 -0600 Subject: Added undo for permission target. https://fedorahosted.org/freeipa/ticket/885 --- install/ui/widget.js | 39 +++++++++++++++++++++++++++++---------- 1 file changed, 29 insertions(+), 10 deletions(-) (limited to 'install/ui/widget.js') diff --git a/install/ui/widget.js b/install/ui/widget.js index 9f6365a0..8f3eeb62 100644 --- a/install/ui/widget.js +++ b/install/ui/widget.js @@ -32,7 +32,10 @@ IPA.widget = function(spec) { that.name = spec.name; that.label = spec.label; that.tooltip = spec.tooltip; + + that.disabled = spec.disabled; that.read_only = spec.read_only; + that._entity_name = spec.entity_name; that.width = spec.width; @@ -257,14 +260,18 @@ IPA.text_widget = function(spec) { $('', { type: 'text', name: that.name, + disabled: that.disabled, size: that.size, title: that.tooltip }).appendTo(container); if (that.undo) { + container.append(' '); that.create_undo(container); } + container.append(' '); + $("",{ name:'error_link', html:"Text does not match field pattern", @@ -452,11 +459,11 @@ IPA.checkboxes_widget = function (spec) { inputs.get(i).checked = false; } - for (var j=0; j', { + name: that.name, rows: that.rows, cols: that.cols, - name: that.name, + disabled: that.disabled, title: that.tooltip }).appendTo(container); if (that.undo) { + container.append(' '); that.create_undo(container); } @@ -663,7 +672,7 @@ IPA.textarea_widget = function (spec) { var input = $('textarea[name="'+that.name+'"]', that.container); input.keyup(function() { - undo.css('display', 'inline'); + that.show_undo(); var value = $(this).val(); that.validate_input(value); @@ -1055,6 +1064,7 @@ IPA.table_widget = function (spec) { return that; }; + IPA.entity_select_widget = function(spec){ var that = IPA.widget(spec); @@ -1064,6 +1074,14 @@ IPA.entity_select_widget = function(spec){ function populate_select(value){ function find_success(result){ $('option', that.entity_select).remove(); + + // add default empty value + $('