From bef8fd566fa4ea8fbf790bfafca475641982eb88 Mon Sep 17 00:00:00 2001 From: Bruno Da Silva Date: Tue, 22 May 2018 13:20:07 +0000 Subject: [PATCH] Advanced search: fix a side effect of the new behaviour "validate the draft" when the criteria is closed by a click outside of it's box - when a criteria is being edited and the user click on search/refresh button, the search handler now update the criteria BEFORE making the ajax call SVN:trunk[5804] --- js/search/search_form_handler.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/js/search/search_form_handler.js b/js/search/search_form_handler.js index b6dd92f43..dac06a8ba 100644 --- a/js/search/search_form_handler.js +++ b/js/search/search_form_handler.js @@ -946,8 +946,17 @@ $(function() // Button handlers _onSubmitClick: function(oEvent) { - // Assertion: the search is already up to date - this._submit(); + + //if there is an opened criteria let's get it's new value before processing + if (this.elements.criterion_area.find('.sf_criteria.opened').length > 0) + { + this.elements.criterion_area.find('.sf_criteria.opened').trigger('itop.search.criteria.close'); + setTimeout(this._submit.call(this), 300); + } + else + { + this._submit(); + } },