diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-07-09 03:01:46 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-07-11 22:11:40 +0000 |
commit | 3229eee074e6b419f64faa9bb701a60fe96da3a6 (patch) | |
tree | 092087c3d74aad8f5afe58af33b6b38c5e427963 /install/ui/association.js | |
parent | 04753403445dd5b73baa1422206b5ca352281e4a (diff) | |
download | freeipa-3229eee074e6b419f64faa9bb701a60fe96da3a6.tar.gz freeipa-3229eee074e6b419f64faa9bb701a60fe96da3a6.tar.xz freeipa-3229eee074e6b419f64faa9bb701a60fe96da3a6.zip |
Added sudo options.
A table has been added into sudo rule details page for managing
sudo options.
Ticket #1447
Diffstat (limited to 'install/ui/association.js')
-rw-r--r-- | install/ui/association.js | 121 |
1 files changed, 55 insertions, 66 deletions
diff --git a/install/ui/association.js b/install/ui/association.js index 56a2761c1..b78e1e36b 100644 --- a/install/ui/association.js +++ b/install/ui/association.js @@ -355,88 +355,77 @@ IPA.association_table_widget = function (spec) { that.table_create(container); - var buttons = $('span[name=buttons]', container); - - $('<input/>', { - 'type': 'button', - 'name': 'remove', - 'value': IPA.messages.buttons.remove - }).appendTo(buttons); - - $('<input/>', { - 'type': 'button', - 'name': 'add', - 'value': IPA.messages.buttons.add - }).appendTo(buttons); - }; + var button = IPA.action_button({ + name: 'remove', + label: IPA.messages.buttons.remove, + icon: 'remove-icon', + click: function() { + that.remove_handler(); + return false; + } + }).appendTo(that.buttons); - that.setup = function(container) { + button = IPA.action_button({ + name: 'add', + label: IPA.messages.buttons.add, + icon: 'add-icon', + click: function() { + that.add_handler(); + return false; + } + }).appendTo(that.buttons); + }; - that.table_setup(container); + that.add_handler = function() { + if ($(this).hasClass('action-button-disabled')) { + return; + } var entity = IPA.get_entity(that.entity_name); var facet_name = IPA.current_facet(entity); var facet = entity.get_facet(facet_name); - var button = $('input[name=remove]', container); - button.replaceWith(IPA.action_button({ - name: 'remove', - 'label': button.val(), - 'icon': 'remove-icon', - 'click': function() { - if ($(this).hasClass('action-button-disabled')) { - return false; - } - - if (facet.is_dirty()) { - var dialog = IPA.dirty_dialog({ - facet: facet - }); - - dialog.callback = function() { - that.show_remove_dialog(); - }; + if (facet.is_dirty()) { + var dialog = IPA.dirty_dialog({ + facet: facet + }); - dialog.init(); - dialog.open(that.container); + dialog.callback = function() { + that.show_add_dialog(); + }; - } else { - that.show_remove_dialog(); - } + dialog.init(); + dialog.open(that.container); - return false; - } - })); + } else { + that.show_add_dialog(); + } + }; - button = $('input[name=add]', container); - button.replaceWith(IPA.action_button({ - name: 'add', - 'label': button.val(), - 'icon': 'add-icon', - 'click': function() { - if ($(this).hasClass('action-button-disabled')) { - return false; - } + that.remove_handler = function() { + if ($(this).hasClass('action-button-disabled')) { + return; + } - if (facet.is_dirty()) { - var dialog = IPA.dirty_dialog({ - facet: facet - }); + var entity = IPA.get_entity(that.entity_name); + var facet_name = IPA.current_facet(entity); + var facet = entity.get_facet(facet_name); - dialog.callback = function() { - that.show_add_dialog(); - }; + if (facet.is_dirty()) { + var dialog = IPA.dirty_dialog({ + facet: facet + }); - dialog.init(); - dialog.open(that.container); + dialog.callback = function() { + that.show_remove_dialog(); + }; - } else { - that.show_add_dialog(); - } + dialog.init(); + dialog.open(that.container); - return false; - } - })); + } else { + that.show_remove_dialog(); + } }; that.set_enabled = function(enabled) { |