summaryrefslogtreecommitdiffstats
path: root/install/ui/host.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-09-28 15:56:25 -0500
committerEndi S. Dewata <edewata@redhat.com>2011-09-29 16:57:19 +0000
commitf99ab781ea33f0d7ca6df26090cd99f9315454ac (patch)
tree548558b589a656503eeb50aa090eed3a45b6f8e4 /install/ui/host.js
parentecb58275e30f215143c57bdf96094103c8fda7ba (diff)
downloadfreeipa-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/host.js')
-rw-r--r--install/ui/host.js84
1 files changed, 50 insertions, 34 deletions
diff --git a/install/ui/host.js b/install/ui/host.js
index 01b366e5e..007d20387 100644
--- a/install/ui/host.js
+++ b/install/ui/host.js
@@ -508,20 +508,28 @@ IPA.host_keytab_widget = function(spec) {
dialog.container.append(IPA.messages.objects.host.unprovision_confirmation);
};
- dialog.add_button(IPA.messages.objects.host.unprovision, function() {
- that.unprovision(
- function(data, text_status, xhr) {
- set_status('missing');
- dialog.close();
- },
- function(xhr, text_status, error_thrown) {
- dialog.close();
- }
- );
+ dialog.create_button({
+ name: 'unprovision',
+ label: IPA.messages.objects.host.unprovision,
+ click: function() {
+ that.unprovision(
+ function(data, text_status, xhr) {
+ set_status('missing');
+ dialog.close();
+ },
+ function(xhr, text_status, error_thrown) {
+ dialog.close();
+ }
+ );
+ }
});
- 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);
@@ -637,34 +645,42 @@ IPA.host_password_widget = function(spec) {
type: 'password'
}));
- dialog.add_button(label, function() {
-
- var record = {};
- dialog.save(record);
+ dialog.create_button({
+ name: 'set_password',
+ label: label,
+ click: function() {
- var new_password = record.password1[0];
- var repeat_password = record.password2[0];
+ var record = {};
+ dialog.save(record);
- if (new_password != repeat_password) {
- alert(IPA.messages.password.password_must_match);
- return;
- }
+ var new_password = record.password1[0];
+ var repeat_password = record.password2[0];
- that.set_password(
- new_password,
- function(data, text_status, xhr) {
- that.load(data.result.result);
- dialog.close();
- },
- function(xhr, text_status, error_thrown) {
- dialog.close();
+ if (new_password != repeat_password) {
+ alert(IPA.messages.password.password_must_match);
+ return;
}
- );
- dialog.close();
+
+ that.set_password(
+ new_password,
+ function(data, text_status, xhr) {
+ that.load(data.result.result);
+ dialog.close();
+ },
+ function(xhr, text_status, error_thrown) {
+ dialog.close();
+ }
+ );
+ dialog.close();
+ }
});
- 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);