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
This commit is contained in:
Petr Vobornik
2012-10-25 14:10:47 +02:00
parent e433379c46
commit 14b353b097
2 changed files with 2 additions and 1 deletions

View File

@@ -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);
}

View File

@@ -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();
};