search widget : bugfix

if the selected operator is not the default one, open in "advanced" mode in order to be able to see the operator

SVN:b1162[5571]
This commit is contained in:
Bruno Da Silva
2018-03-29 10:12:20 +00:00
parent 04154fa40c
commit dfab460478

View File

@@ -189,16 +189,14 @@ $(function()
}
// Focus on right input
var oOpElemToFocus;
if(this.element.find('.sfc_form_group').hasClass('advanced'))
var oOpElemRadioChecked = this.element.find('.sfc_fg_operator .sfc_op_radio:checked');
if (!oOpElemRadioChecked.is(':visible'))
{
oOpElemToFocus = this.element.find('.sfc_fg_operator .sfc_op_radio:checked').closest('.sfc_fg_operator');
this.element.find('.sfc_form_group').addClass('advanced');
}
else
{
oOpElemToFocus = this.element.find('.sfc_fg_operator:first');
}
oOpElemToFocus.find('.sfc_op_content input[type="text"]:first').filter(':not([data-no-auto-focus])').trigger('click').trigger('focus');
oOpElemRadioChecked.closest('.sfc_fg_operator').find('.sfc_op_content input[type="text"]:first').filter(':not([data-no-auto-focus])').trigger('click').trigger('focus');
},
_close: function()
{