diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-07-31 12:57:53 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-08-21 14:10:35 +0200 |
commit | d138b44480dfef3220e0a39bef9c064a314ee6bf (patch) | |
tree | 51fafffa09f9280838aaf0a45345a7df496ff7f7 /install/ui/src | |
parent | 356059e07ddb492aa9d6b63ee806ae804afbec40 (diff) | |
download | freeipa-d138b44480dfef3220e0a39bef9c064a314ee6bf.tar.gz freeipa-d138b44480dfef3220e0a39bef9c064a314ee6bf.tar.xz freeipa-d138b44480dfef3220e0a39bef9c064a314ee6bf.zip |
webui: sshkey widget - usability fixes
- save one click by opening edit dialog right after adding new row
- add margin between fingerprint and "show/edit" button
- fix honoring of writable/read-only flags upon row creation
Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
Diffstat (limited to 'install/ui/src')
-rw-r--r-- | install/ui/src/freeipa/widget.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 7b1f14041..4edc6ca8c 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -1116,6 +1116,12 @@ IPA.multivalued_widget = function(spec) { row.container.insertBefore(that.add_link); that.toggle_remove_link(row, remove_link_visible); + return row; + }; + + that.new_row = function() { + that.add_row(''); + that.focus_last(); }; that.toggle_remove_link = function(row, show) { @@ -1141,8 +1147,7 @@ IPA.multivalued_widget = function(spec) { title: text.get('@i18n:buttons.add'), html: text.get('@i18n:buttons.add'), click: function() { - that.add_row(''); - that.focus_last(); + that.new_row(); return false; } }).appendTo(container); @@ -5213,10 +5218,15 @@ exp.widget_builder = IPA.widget_builder = function(spec) { IPA.sshkeys_widget = function(spec) { spec = spec || {}; - spec.child_spec = IPA.sshkey_widget; + spec.child_spec = { $factory: IPA.sshkey_widget }; var that = IPA.multivalued_widget(spec); + that.new_row = function() { + var row = that.add_row(''); + row.widget.open_edit_dialog(); + }; + that.test_dirty_row = function(row) { if(row.deleted || row.is_new) return true; |