summaryrefslogtreecommitdiffstats
path: root/install
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-09-30 16:52:41 -0500
committerMartin Kosek <mkosek@redhat.com>2011-10-03 15:16:15 +0200
commita013597e7c5ec4b6d665988d8aaaac941a7ff1a9 (patch)
tree6bbbef8cea80ab7b9b07d8d1d285cc5d9caaf7fe /install
parentaf8350c327f0e68775c7d2a50c7d42fd7a5919f0 (diff)
downloadfreeipa-a013597e7c5ec4b6d665988d8aaaac941a7ff1a9.tar.gz
freeipa-a013597e7c5ec4b6d665988d8aaaac941a7ff1a9.tar.xz
freeipa-a013597e7c5ec4b6d665988d8aaaac941a7ff1a9.zip
Disable sudo options Delete button if nothing selected.
The Delete button for sudo options in sudo rule details page now will only work if there is at least one row selected. Ticket #1896
Diffstat (limited to 'install')
-rw-r--r--install/ui/sudo.js26
1 files changed, 22 insertions, 4 deletions
diff --git a/install/ui/sudo.js b/install/ui/sudo.js
index 8586f5760..8228951c3 100644
--- a/install/ui/sudo.js
+++ b/install/ui/sudo.js
@@ -503,26 +503,44 @@ IPA.sudo.options_section = function(spec) {
that.table.table_create(container);
- var button = IPA.action_button({
+ that.remove_button = IPA.action_button({
name: 'remove',
label: IPA.messages.buttons.remove,
icon: 'remove-icon',
+ 'class': 'action-button-disabled',
click: function() {
- that.remove_handler();
+ if (!that.remove_button.hasClass('action-button-disabled')) {
+ that.remove_handler();
+ }
return false;
}
}).appendTo(that.table.buttons);
- button = IPA.action_button({
+ that.add_button = IPA.action_button({
name: 'add',
label: IPA.messages.buttons.add,
icon: 'add-icon',
click: function() {
- that.add_handler();
+ if (!that.add_button.hasClass('action-button-disabled')) {
+ that.add_handler();
+ }
return false;
}
}).appendTo(that.table.buttons);
};
+
+ that.table.select_changed = function() {
+
+ var values = that.table.get_selected_values();
+
+ if (that.remove_button) {
+ if (values.length === 0) {
+ that.remove_button.addClass('action-button-disabled');
+ } else {
+ that.remove_button.removeClass('action-button-disabled');
+ }
+ }
+ };
}
that.add_handler = function() {