Skip to content

Commit

Permalink
tweak trim logic
Browse files Browse the repository at this point in the history
  • Loading branch information
cedrikv committed Aug 7, 2020
1 parent e6805e7 commit 6718c0b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion atramhasis/static/admin/src/app/ui/widgets/SearchPane.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,10 @@ define([
_search: function (evt) {
evt ? evt.preventDefault() : null;
var schemeId = domUtils.getSelectedOption(this.conceptSchemeSelect);

this.matchInput.value = this.matchInput.value.trim();
this.labelInput.value = this.labelInput.value.trim();

if (schemeId == -1) {
topic.publish('dGrowl', "You have to select a scheme.", {'title': "", 'sticky': false, 'channel':'warn'});
return;
Expand All @@ -262,7 +266,7 @@ define([
label: this.labelInput.value,
sort: '+label'
};
if (this.matchInput.value.trim() !== '') {
if (this.matchInput.value !== '') {
filter.match= this.matchInput.value;
}
var store = this.appUi.conceptController.getConceptStore(schemeId).filter(filter);
Expand Down

0 comments on commit 6718c0b

Please sign in to comment.