diff options
author | Endi S. Dewata <edewata@redhat.com> | 2011-09-28 15:56:25 -0500 |
---|---|---|
committer | Endi S. Dewata <edewata@redhat.com> | 2011-09-29 16:57:19 +0000 |
commit | f99ab781ea33f0d7ca6df26090cd99f9315454ac (patch) | |
tree | 548558b589a656503eeb50aa090eed3a45b6f8e4 /install/ui/sudo.js | |
parent | ecb58275e30f215143c57bdf96094103c8fda7ba (diff) | |
download | freeipa-f99ab781ea33f0d7ca6df26090cd99f9315454ac.tar.gz freeipa-f99ab781ea33f0d7ca6df26090cd99f9315454ac.tar.xz freeipa-f99ab781ea33f0d7ca6df26090cd99f9315454ac.zip |
Disable enroll button if nothing selected.
A new IPA.dialog_button class has been added to encapsulate the
buttons in the dialog box so they can be managed more easily.
The adder dialog has been modified to disable the enroll button if
there is no entries selected.
Ticket #1856
Diffstat (limited to 'install/ui/sudo.js')
-rw-r--r-- | install/ui/sudo.js | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/install/ui/sudo.js b/install/ui/sudo.js index acc1c9f4..6855283e 100644 --- a/install/ui/sudo.js +++ b/install/ui/sudo.js @@ -609,33 +609,41 @@ IPA.sudo.options_section = function(spec) { label: label })); - dialog.add_button(IPA.messages.buttons.add, function() { - var value = ipasudoopt.save()[0]; + dialog.create_button({ + name: 'add', + label: IPA.messages.buttons.add, + click: function() { + var value = ipasudoopt.save()[0]; - var pkey = IPA.nav.get_state(that.entity.name+'-pkey'); + var pkey = IPA.nav.get_state(that.entity.name+'-pkey'); - var command = IPA.command({ - entity: 'sudorule', - method: 'add_option', - args: [pkey], - options: { - ipasudoopt: value - }, - on_success: function(data) { - that.load(data.result.result); - dialog.close(); - }, - on_error: function(data) { - that.update(); - dialog.close(); - } - }); + var command = IPA.command({ + entity: 'sudorule', + method: 'add_option', + args: [pkey], + options: { + ipasudoopt: value + }, + on_success: function(data) { + that.load(data.result.result); + dialog.close(); + }, + on_error: function(data) { + that.update(); + dialog.close(); + } + }); - command.execute(); + command.execute(); + } }); - dialog.add_button(IPA.messages.buttons.cancel, function() { - dialog.close(); + dialog.create_button({ + name: 'cancel', + label: IPA.messages.buttons.cancel, + click: function() { + dialog.close(); + } }); dialog.open(that.container); |