summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2012-10-25 14:10:47 +0200
committerPetr Vobornik <pvoborni@redhat.com>2013-02-21 13:04:57 +0100
commit06a6ef87d81a0300c716dac47a998dcbc38fbcc2 (patch)
tree7f4e55f64148d182576701a42923c7cd691eae1c
parent8e3b09310e615036570ab29fb7c2d1f3009aa2b2 (diff)
downloadfreeipa.git-06a6ef87d81a0300c716dac47a998dcbc38fbcc2.tar.gz
freeipa.git-06a6ef87d81a0300c716dac47a998dcbc38fbcc2.tar.xz
freeipa.git-06a6ef87d81a0300c716dac47a998dcbc38fbcc2.zip
Focus first input element after 'Add and Add another'
When using 'Add and Add Another' button in entity adder dialog the dialog lose focus when an item is successfully added. It caused by search dialog filter input. It gets focus in search facet's refresh. The refresh is happening when item is added. This patch is disabling this focus and additionally is focusing first input element to allow imidiate definion of another item
-rw-r--r--install/ui/add.js1
-rw-r--r--install/ui/search.js2
2 files changed, 2 insertions, 1 deletions
diff --git a/install/ui/add.js b/install/ui/add.js
index 2fd50ee6..6d3f454b 100644
--- a/install/ui/add.js
+++ b/install/ui/add.js
@@ -63,6 +63,7 @@ IPA.entity_adder_dialog = function(spec) {
var facet = IPA.current_entity.get_facet();
facet.refresh();
that.reset();
+ that.focus_first_element();
},
that.on_error);
}
diff --git a/install/ui/search.js b/install/ui/search.js
index 28723d3e..b54c375f 100644
--- a/install/ui/search.js
+++ b/install/ui/search.js
@@ -215,7 +215,7 @@ IPA.search_facet = function(spec, no_init) {
var command = that.create_refresh_command();
command.on_success = function(data, text_status, xhr) {
- that.filter.focus();
+ if (!IPA.opened_dialogs.dialogs.length) that.filter.focus();
that.load(data);
that.show_content();
};