diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2013-06-28 16:50:52 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2013-08-13 12:41:48 +0200 |
commit | ff6f958d96110a305d2837c89a5415ac0db3c9bc (patch) | |
tree | 5113a59fd103cd182e63dec92433eb9adda9628c /install/ui | |
parent | 69394bab5a279a07f596d529cfd01c858a48229c (diff) | |
download | freeipa-ff6f958d96110a305d2837c89a5415ac0db3c9bc.tar.gz freeipa-ff6f958d96110a305d2837c89a5415ac0db3c9bc.tar.xz freeipa-ff6f958d96110a305d2837c89a5415ac0db3c9bc.zip |
Make ssh_widget not-editable if attr is readonly
https://fedorahosted.org/freeipa/ticket/3800
Diffstat (limited to 'install/ui')
-rw-r--r-- | install/ui/ipa.css | 4 | ||||
-rw-r--r-- | install/ui/src/freeipa/widget.js | 31 |
2 files changed, 24 insertions, 11 deletions
diff --git a/install/ui/ipa.css b/install/ui/ipa.css index ad3d1aa1..26df9409 100644 --- a/install/ui/ipa.css +++ b/install/ui/ipa.css @@ -53,6 +53,10 @@ body { height: 100%; } +textarea[readonly] { + color: Gray; +} + .network-activity-indicator { visibility: hidden; width: 16px; diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index d66468ae..85077275 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -3796,6 +3796,8 @@ IPA.sshkey_widget = function(spec) { that.create_edit_dialog = function() { + var writable = that.is_writable(); + var dialog = IPA.dialog({ name: 'sshkey-edit-dialog', title: '@i18n:objects.sshkeystore.set_dialog_title', @@ -3805,19 +3807,26 @@ IPA.sshkey_widget = function(spec) { dialog.message = text.get('@i18n:objects.sshkeystore.set_dialog_help'); - dialog.create_button({ - name: 'update', - label: '@i18n:buttons.set', - click: function() { - var value = dialog.textarea.val(); - that.set_user_value(value); - dialog.close(); - } - }); + if (writable) { + dialog.create_button({ + name: 'update', + label: '@i18n:buttons.set', + click: function() { + var value = dialog.textarea.val(); + that.set_user_value(value); + dialog.close(); + } + }); + } + + var label = '@i18n:buttons.cancel'; + if (!writable) { + label = '@i18n:buttons.close'; + } dialog.create_button({ name: 'cancel', - label: '@i18n:buttons.cancel', + label: label, click: function() { dialog.close(); } @@ -3829,7 +3838,7 @@ IPA.sshkey_widget = function(spec) { dialog.textarea = $('<textarea/>', { 'class': 'certificate', - readonly: that.read_only, + readonly: !writable, disabled: !that.enabled }).appendTo(dialog.container); |