mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 17:18:51 +02:00
Advanced search: Enum/ExtKey criterion now supports min_autocomplete_chars conf parameter in autocomplete.
SVN:trunk[5620]
This commit is contained in:
@@ -812,7 +812,6 @@ input.dp-applied {
|
||||
padding: 1px 2px;
|
||||
}
|
||||
|
||||
|
||||
&:not(.closed){
|
||||
.sf_title{
|
||||
.sft_toggler{
|
||||
@@ -841,8 +840,6 @@ input.dp-applied {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
.sf_title{
|
||||
transition: opacity 0.3s, background-color 0.3s, color 0.3s linear;
|
||||
padding: 8px 10px;
|
||||
|
||||
@@ -32,7 +32,7 @@ $(function()
|
||||
// Autocomplete
|
||||
'autocomplete': {
|
||||
'xhr_throttle': 200,
|
||||
'min_autocomplete_chars': 3, // TODO: Pass this through widget instanciation.
|
||||
'min_autocomplete_chars': 3,
|
||||
},
|
||||
},
|
||||
|
||||
@@ -325,7 +325,7 @@ $(function()
|
||||
}
|
||||
|
||||
var sQuery = $(this).val();
|
||||
if( (sQuery === '') ) // TODO: Put this back after tests|| (sQuery.length < me.options.autocomplete.min_autocomplete_chars) )
|
||||
if( (sQuery === '') || (sQuery.length < me.options.autocomplete.min_autocomplete_chars) )
|
||||
{
|
||||
me._setACTypingHint();
|
||||
oFilterElem.find('.sff_reset').hide();
|
||||
|
||||
@@ -13,15 +13,8 @@ $(function()
|
||||
'result_list_outer_selector': null,
|
||||
'data_config_list_selector': null,
|
||||
'submit_button_selector': null,
|
||||
'hide_initial_criterion': false, // TODO: What is that?
|
||||
'endpoint': null,
|
||||
'init_opened': false,
|
||||
"datepicker":
|
||||
{
|
||||
"dayNamesMin": ["Su","Mo","Tu","We","Th","Fr","Sa"],
|
||||
"monthNamesShort": ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],
|
||||
"firstDay": 0
|
||||
},
|
||||
'search': {
|
||||
'base_oql': '',
|
||||
'class_name': null,
|
||||
@@ -73,6 +66,14 @@ $(function()
|
||||
],
|
||||
},
|
||||
'default_criteria_type': 'raw',
|
||||
'conf_parameters': {
|
||||
'min_autocomplete_chars': 3,
|
||||
'datepicker': {
|
||||
'dayNamesMin': ['Su','Mo','Tu','We','Th','Fr','Sa'],
|
||||
'monthNamesShort': ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
||||
'firstDay': 0,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
// jQuery elements
|
||||
@@ -100,7 +101,7 @@ $(function()
|
||||
};
|
||||
|
||||
//init others widgets :
|
||||
this.element.search_form_handler_history({"itop_root_class":me.options.search.class_name});
|
||||
this.element.search_form_handler_history({'itop_root_class':me.options.search.class_name});
|
||||
|
||||
// Prepare DOM elements
|
||||
this._prepareFormArea();
|
||||
@@ -267,7 +268,6 @@ $(function()
|
||||
// Prevent toggle on <select>
|
||||
if(oEvent.target.nodeName.toLowerCase() !== 'select')
|
||||
{
|
||||
//me.element.find('.sf_criterion_area').slideToggle('fast');
|
||||
me.element.toggleClass('closed');
|
||||
}
|
||||
});
|
||||
@@ -711,9 +711,16 @@ $(function()
|
||||
};
|
||||
}
|
||||
|
||||
if ('date' == sType || 'date_time' == sType)
|
||||
// Add widget specific data
|
||||
if( (sType === 'date') || (sType === 'date_time') )
|
||||
{
|
||||
oData.datepicker = this.options.datepicker;
|
||||
oData.datepicker = this.options.conf_parameters.datepicker;
|
||||
}
|
||||
if( (sType === 'enum') || (sType === 'external_key') )
|
||||
{
|
||||
oData.autocomplete = {
|
||||
'min_autocomplete_chars': this.options.conf_parameters.min_autocomplete_chars,
|
||||
};
|
||||
}
|
||||
|
||||
// Create DOM element
|
||||
|
||||
@@ -196,13 +196,6 @@ class SearchForm
|
||||
'data_config_list_selector' => "#{$sDataConfigListSelector}",
|
||||
'endpoint' => utils::GetAbsoluteUrlAppRoot().'pages/ajax.searchform.php',
|
||||
'init_opened' => $bOpen,
|
||||
'datepicker' => array(
|
||||
'dayNamesMin' => $aDaysMin,
|
||||
'monthNamesShort' => $aMonthsShort,
|
||||
'firstDay' => (int) Dict::S('Calendar-FirstDayOfWeek'),
|
||||
// 'date_format' => AttributeDate::GetFormat()->ToDatePicker(),
|
||||
// 'date_time_format' => AttributeDateTime::GetFormat()->ToMomentJS(),
|
||||
),
|
||||
'list_params' => $aListParams,
|
||||
'search' => array(
|
||||
'has_hidden_criteria' => (array_key_exists('hidden_criteria', $aListParams) && !empty($aListParams['hidden_criteria'])),
|
||||
@@ -212,6 +205,14 @@ class SearchForm
|
||||
'class_alias' => $sClassAlias,
|
||||
'base_oql' => $sBaseOQL,
|
||||
),
|
||||
'conf_parameters' => array(
|
||||
'min_autocomplete_chars' => MetaModel::GetConfig()->Get('min_autocomplete_chars'),
|
||||
'datepicker' => array(
|
||||
'dayNamesMin' => $aDaysMin,
|
||||
'monthNamesShort' => $aMonthsShort,
|
||||
'firstDay' => (int) Dict::S('Calendar-FirstDayOfWeek'),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
$oPage->add_ready_script('$("#fs_'.$sSearchFormId.'").search_form_handler('.json_encode($aSearchParams).');');
|
||||
|
||||
Reference in New Issue
Block a user