summaryrefslogtreecommitdiffstats
path: root/install/ui/add.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/add.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/add.js')
-rw-r--r--install/ui/add.js72
1 files changed, 44 insertions, 28 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index 21707df13..5a4537ba3 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -111,40 +111,56 @@ IPA.add_dialog = function (spec) {
};
/*dialog initialization*/
- that.add_button(IPA.messages.buttons.add, function() {
- that.add(
- function(data, text_status, xhr) {
- var facet = IPA.current_entity.get_facet();
- var table = facet.table;
- table.refresh();
- that.close();
- },
- that.on_error);
+ that.create_button({
+ name: 'add',
+ label: IPA.messages.buttons.add,
+ click: function() {
+ that.add(
+ function(data, text_status, xhr) {
+ var facet = IPA.current_entity.get_facet();
+ var table = facet.table;
+ table.refresh();
+ that.close();
+ },
+ that.on_error);
+ }
});
- that.add_button(IPA.messages.buttons.add_and_add_another, function() {
- that.add(
- function(data, text_status, xhr) {
- var facet = IPA.current_entity.get_facet();
- var table = facet.table;
- table.refresh();
- that.reset();
- },
- that.on_error);
+ that.create_button({
+ name: 'add_and_add_another',
+ label: IPA.messages.buttons.add_and_add_another,
+ click: function() {
+ that.add(
+ function(data, text_status, xhr) {
+ var facet = IPA.current_entity.get_facet();
+ var table = facet.table;
+ table.refresh();
+ that.reset();
+ },
+ that.on_error);
+ }
});
- that.add_button(IPA.messages.buttons.add_and_edit, function() {
- that.add(
- function(data, text_status, xhr) {
- that.close();
- var result = data.result.result;
- that.show_edit_page(that.entity, result);
- },
- that.on_error);
+ that.create_button({
+ name: 'add_and_edit',
+ label: IPA.messages.buttons.add_and_edit,
+ click: function() {
+ that.add(
+ function(data, text_status, xhr) {
+ that.close();
+ var result = data.result.result;
+ that.show_edit_page(that.entity, result);
+ },
+ that.on_error);
+ }
});
- that.add_button(IPA.messages.buttons.cancel, function() {
- that.close();
+ that.create_button({
+ name: 'cancel',
+ label: IPA.messages.buttons.cancel,
+ click: function() {
+ that.close();
+ }
});
return that;