diff --git a/js/search/search_form_criteria.js b/js/search/search_form_criteria.js index ae8269401..fa036bd52 100644 --- a/js/search/search_form_criteria.js +++ b/js/search/search_form_criteria.js @@ -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(); diff --git a/js/search/search_form_criteria_enum.js b/js/search/search_form_criteria_enum.js index bb0d91a6d..02e7b2610 100644 --- a/js/search/search_form_criteria_enum.js +++ b/js/search/search_form_criteria_enum.js @@ -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