Advanced search: WIP POC, UI/UX.

SVN:b1162[5489]
This commit is contained in:
Guillaume Lajarige
2018-03-21 15:34:00 +00:00
parent 3cdf22e9b2
commit 6afb3a06ac
2 changed files with 15 additions and 9 deletions

View File

@@ -249,13 +249,11 @@ $(function()
// Update widget
this.options.operator = oActiveOpElem.find('.sfc_op_radio').val();
if (JSON.stringify(this.options.values) != JSON.stringify(aValues))
{
this.is_modified = true;
this.options.oql = '';
this.options.values = aValues;
this._setTitle();
}
// TODO: Better modification check. The previous if has been removed as it caused a regression.
this.is_modified = true;
this.options.oql = '';
this.options.values = aValues;
this._setTitle();
this._unmarkAsDraft();

View File

@@ -170,7 +170,10 @@ $(function()
});
// - Apply on check
oAllowedValuesElem.find('.sfc_opc_mc_item').on('click', function(oEvent){
oAllowedValuesElem.find('.sfc_opc_mc_item input').on('click', function(oEvent){
// Prevent propagation, otherwise there will be multiple "_apply()"
oEvent.stopPropagation();
// Uncheck toggler
oTogglersElem.find('input:checkbox').prop('checked', false);
@@ -184,7 +187,12 @@ $(function()
{
var iValLimit = 3;
var iValCount = Object.keys(this.options.values).length;
if(iValCount > iValLimit)
var iAllowedValuesCount = (this.options.field.allowed_values.values !== undefined) ? Object.keys(this.options.field.allowed_values.values).length : 0;
if( (iValCount === 0) || (iValCount === iAllowedValuesCount) )
{
sTitle = Dict.Format('UI:Search:Criteria:Title:Enum:In:All', this.options.field.label);
}
else if(iValCount > iValLimit)
{
var aFirstValues = [];
for(var i=0; i<iValLimit-1; i++)