Commit 262ad96a authored by Clement Ho's avatar Clement Ho

Remove unnecessary function

parent aebee118
...@@ -27,20 +27,12 @@ ...@@ -27,20 +27,12 @@
return this.droplab.hooks.filter(h => h.id === this.hookId)[0]; return this.droplab.hooks.filter(h => h.id === this.hookId)[0];
} }
getSelectedText(selectedToken) {
// TODO: Get last word from FilteredSearchTokenizer
const lastWord = this.input.value.split(' ').last();
const lastWordIndex = selectedToken.indexOf(lastWord);
return lastWordIndex === -1 ? selectedToken : selectedToken.slice(lastWord.length);
}
itemClicked(e, getValueFunction) { itemClicked(e, getValueFunction) {
const dataValueSet = this.setDataValueIfSelected(e.detail.selected); const dataValueSet = this.setDataValueIfSelected(e.detail.selected);
if (!dataValueSet) { if (!dataValueSet) {
const value = getValueFunction(e.detail.selected) const value = getValueFunction(e.detail.selected);
gl.FilteredSearchDropdownManager.addWordToInput(this.getSelectedText(value)); gl.FilteredSearchDropdownManager.addWordToInput(value);
} }
this.dismissDropdown(); this.dismissDropdown();
......
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