Commit d030b525 by kevalbhatt

ATLAS-3061: UI Search Term is not working

parent 1cb155a2
...@@ -253,13 +253,15 @@ define(['require', ...@@ -253,13 +253,15 @@ define(['require',
}); });
}, },
checkForButtonVisiblity: function(e, options) { checkForButtonVisiblity: function(e, options) {
var that = this;
if (this.type == "basic" && e && e.currentTarget) { if (this.type == "basic" && e && e.currentTarget) {
var $el = $(e.currentTarget), var $el = $(e.currentTarget),
isTagEl = $el.data('id') == "tagLOV", isTagEl = $el.data('id') == "tagLOV",
isTermEl = $el.data('id') == "termLOV", isTermEl = $el.data('id') == "termLOV",
isTypeEl = $el.data('id') == "typeLOV"; isTypeEl = $el.data('id') == "typeLOV",
if (e.type == "change" && $el.select2('data')) { select2Data = $el.select2('data');
var value = $($el).find(':selected').data('name'), if (e.type == "change" && select2Data) {
var value = (_.isEmpty(select2Data) ? select2Data : _.first(select2Data).id),
key = "tag", key = "tag",
filterType = 'tagFilters', filterType = 'tagFilters',
value = value && value.length ? value : null; value = value && value.length ? value : null;
...@@ -310,10 +312,11 @@ define(['require', ...@@ -310,10 +312,11 @@ define(['require',
} }
} }
} }
var that = this,
value = this.ui.searchInput.val() || $(this.ui.typeLov).find(':selected').data('name'); var value = this.ui.searchInput.val() || _.first($(this.ui.typeLov).select2('data')).id;
if (!this.dsl && !value) { if (!this.dsl && _.isEmpty(value)) {
value = $(this.ui.tagLov).find(':selected').data('name') || $(this.ui.termLov).find(':selected').data('name') var termData = _.first($(this.ui.termLov).select2('data'));
value = _.first($(this.ui.tagLov).select2('data')).id || (termData ? termData.id : "");
} }
if (value && value.length) { if (value && value.length) {
this.ui.searchBtn.removeAttr("disabled"); this.ui.searchBtn.removeAttr("disabled");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment