Search facet can be without search field

Add attribute 'disable_search_field' which hides search field on search or
nested_search facet.

Part of: https://fedorahosted.org/freeipa/ticket/5906

Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
This commit is contained in:
Pavel Vomacka 2016-06-09 16:14:51 +02:00 committed by Petr Vobornik
parent 1eb5760018
commit 31faf1c21d

View File

@ -114,10 +114,14 @@ IPA.search_facet = function(spec, no_init) {
that.deleter_dialog = spec.deleter_dialog;
that.disable_search_field = !!spec.disable_search_field;
that.create_header = function(container) {
that.facet_create_header(container);
that.create_search_filter(that.controls_left);
if (!that.disable_search_field) {
that.create_search_filter(that.controls_left);
}
that.create_control_buttons(that.controls_right);
that.create_action_dropdown(that.controls_right);
};
@ -282,7 +286,10 @@ IPA.search_facet = function(spec, no_init) {
var command = that.create_refresh_command();
command.on_success = function(data, text_status, xhr) {
if (!IPA.opened_dialogs.dialogs.length) that.filter.focus();
if (!IPA.opened_dialogs.dialogs.length &&
!that.disable_search_field) {
that.filter.focus();
}
that.load(data);
that.show_content();
};