diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2014-07-31 12:57:53 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2014-07-31 13:21:56 +0200 |
commit | d56468ce64b3e951c6a4d128a11aae503f62aca8 (patch) | |
tree | 58b98f2f17f767a040f0be4de3b461673211c076 | |
parent | 8152d01187598b15483694a6ee2b53c15db3c9e4 (diff) | |
download | freeipa-d56468ce64b3e951c6a4d128a11aae503f62aca8.tar.gz freeipa-d56468ce64b3e951c6a4d128a11aae503f62aca8.tar.xz freeipa-d56468ce64b3e951c6a4d128a11aae503f62aca8.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
-rw-r--r-- | install/ui/less/widgets.less | 6 | ||||
-rw-r--r-- | install/ui/src/freeipa/widget.js | 16 |
2 files changed, 19 insertions, 3 deletions
diff --git a/install/ui/less/widgets.less b/install/ui/less/widgets.less index ff6d7ba3f..be594f470 100644 --- a/install/ui/less/widgets.less +++ b/install/ui/less/widgets.less @@ -78,3 +78,9 @@ line-height: @input-height-base + 2; margin-bottom: 2px; } + +// SSH Key Widget + +.sshkey-status { + margin-right: 5px; +}
\ No newline at end of file diff --git a/install/ui/src/freeipa/widget.js b/install/ui/src/freeipa/widget.js index 54291e815..ea4bec28c 100644 --- a/install/ui/src/freeipa/widget.js +++ b/install/ui/src/freeipa/widget.js @@ -1192,6 +1192,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) { @@ -1217,8 +1223,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); @@ -5307,10 +5312,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; |