summaryrefslogtreecommitdiffstats
path: root/install/static/associate.js
diff options
context:
space:
mode:
authorEndi S. Dewata <edewata@redhat.com>2011-01-11 09:51:09 +0700
committerAdam Young <ayoung@redhat.com>2011-01-11 21:33:35 -0500
commit409b6efa5f0d4149fb26513dd25259b9d0026840 (patch)
tree78eeb4cfc0c138ae4547656130554804e19511b8 /install/static/associate.js
parente79406a0f956dc827beb176d9a25d8b983f1fd23 (diff)
downloadfreeipa-409b6efa5f0d4149fb26513dd25259b9d0026840.tar.gz
freeipa-409b6efa5f0d4149fb26513dd25259b9d0026840.tar.xz
freeipa-409b6efa5f0d4149fb26513dd25259b9d0026840.zip
Support for enabling/disabling table widget.
The table widget now can be enabled/disabled. When disabled, the checkboxes and links/buttons are grayed out and non functional. The radio buttons in HBAC and SUDO details page have been modified to enable/disable the corresponding tables.
Diffstat (limited to 'install/static/associate.js')
-rw-r--r--install/static/associate.js19
1 files changed, 17 insertions, 2 deletions
diff --git a/install/static/associate.js b/install/static/associate.js
index 60e7c09ff..12b5fab04 100644
--- a/install/static/associate.js
+++ b/install/static/associate.js
@@ -352,17 +352,32 @@ function ipa_association_table_widget(spec) {
button.replaceWith(IPA.action_button({
'label': button.val(),
'icon': 'ui-icon-trash',
- 'click': function() { that.show_remove_dialog(); }
+ 'click': function() {
+ if ($(this).hasClass('action-button-disabled')) return false;
+ that.show_remove_dialog();
+ }
}));
button = $('input[name=add]', container);
button.replaceWith(IPA.action_button({
'label': button.val(),
'icon': 'ui-icon-plus',
- 'click': function() { that.show_add_dialog() }
+ 'click': function() {
+ if ($(this).hasClass('action-button-disabled')) return false;
+ that.show_add_dialog();
+ }
}));
};
+ that.set_enabled = function(enabled) {
+ that.table_set_enabled(enabled);
+ if (enabled) {
+ $('.action-button', that.table).removeClass('action-button-disabled');
+ } else {
+ $('.action-button', that.table).addClass('action-button-disabled');
+ }
+ };
+
that.get_records = function(on_success, on_error) {
if (!that.values.length) return;