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/ipa.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/ipa.js')
-rw-r--r-- | install/ui/ipa.js | 58 |
1 files changed, 41 insertions, 17 deletions
diff --git a/install/ui/ipa.js b/install/ui/ipa.js index ca081dc0d..a4fef6018 100644 --- a/install/ui/ipa.js +++ b/install/ui/ipa.js @@ -714,21 +714,33 @@ IPA.dirty_dialog = function(spec) { that.container.append(that.message); }; - that.add_button(IPA.messages.buttons.update, function() { - that.facet.update(function() { - that.close(); - that.callback(); - }); + that.create_button({ + name: 'update', + label: IPA.messages.buttons.update, + click: function() { + that.facet.update(function() { + that.close(); + that.callback(); + }); + } }); - that.add_button(IPA.messages.buttons.reset, function() { - that.facet.reset(); - that.close(); - that.callback(); + that.create_button({ + name: 'reset', + label: IPA.messages.buttons.reset, + click: function() { + that.facet.reset(); + that.close(); + that.callback(); + } }); - that.add_button(IPA.messages.buttons.cancel, function() { - that.close(); + that.create_button({ + name: 'cancel', + label: IPA.messages.buttons.cancel, + click: function() { + that.close(); + } }); that.callback = function() { @@ -824,22 +836,34 @@ IPA.error_dialog = function(spec) { if(that.visible_buttons.indexOf('retry') > -1) { label = IPA.get_message('buttons.retry', 'Retry'); - that.add_button(label, function() { - that.on_retry(); + that.create_button({ + name: 'retry', + label: label, + click: function() { + that.on_retry(); + } }); } if(that.visible_buttons.indexOf('ok') > -1) { label = IPA.get_message('buttons.ok', 'OK'); - that.add_button(label, function() { - that.on_ok(); + that.create_button({ + name: 'ok', + label: label, + click: function() { + that.on_ok(); + } }); } if(that.visible_buttons.indexOf('cancel') > -1) { label = IPA.get_message('buttons.cancel', 'Cancel'); - that.add_button(label, function() { - that.on_cancel(); + that.create_button({ + name: 'cancel', + label: label, + click: function() { + that.on_cancel(); + } }); } }; |