Skip to content

Commit

Permalink
Add trash icon and syntax fix
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhwinder33445 committed May 16, 2022
1 parent 0fc368f commit 3071739
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions asset/css/search-field.less
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ form.search-field {
label .term-icon {
display: none;
position: absolute;
right: 6px;
top: -1px;
right: 9px;
top: 1px;
}

label:hover {
Expand Down
26 changes: 13 additions & 13 deletions asset/js/widget/TermInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,23 @@ define(["../notjQuery", "BaseInput"], function ($, BaseInput) {
}

renderTerm(termData, termIndex) {
if (this.isReadOnlyMode()) {
let label = $.render('<label><input type="button"><i class="icon-cancel term-icon"></i></label>');
if (! this.isReadOnlyMode()) {
return super.renderTerm(termData, termIndex);
}

if (termData.class) {
label.classList.add(termData.class);
}
let label = $.render('<label><input type="button"><i class="fa fa-trash term-icon"></i></label>');

label.dataset.label = termData.label;
label.dataset.search = termData.search;
label.dataset.index = termIndex;
if (termData.class) {
label.classList.add(termData.class);
}

label.firstChild.value = termData.label;
label.dataset.label = termData.label;
label.dataset.search = termData.search;
label.dataset.index = termIndex;

return label;
} else {
return super.renderTerm(termData, termIndex);
}
label.firstChild.value = termData.label;

return label;
}

/**
Expand Down

0 comments on commit 3071739

Please sign in to comment.