N°1487 Search: Removing an empty criterion doesn't refresh the results anymore

This commit is contained in:
Molkobain
2018-11-07 14:43:03 +01:00
parent d8cef95d56
commit 0d082bf378
2 changed files with 4 additions and 2 deletions

View File

@@ -253,7 +253,9 @@ $(function()
_remove: function()
{
this.element.remove();
this.handler.triggerHandler('itop.search.criteria.removed');
var bHadValues = (Array.isArray(this.options.values) && (this.options.values.length > 0));
this.handler.triggerHandler('itop.search.criteria.removed', {had_values: bHadValues});
},
// - Mark / Unmark criteria as draft (new value not applied)
_markAsDraft: function()

View File

@@ -909,7 +909,7 @@ $(function()
_onCriteriaRemoved: function(oData)
{
this._updateSearch();
if(this.options.auto_submit === true)
if( (this.options.auto_submit === true) && (oData.had_values === true) )
{
this._submit();
}