Add static methods for dropdowns to interface with

This commit is contained in:
Clement Ho 2016-11-30 12:32:10 -06:00
parent 8ecc2117db
commit 3492ff6784

View file

@ -84,6 +84,21 @@
loadSearchParamsFromURL();
}
static fillInWord(word) {
const originalValue = document.querySelector('.filtered-search').value;
document.querySelector('.filtered-search').value = `${originalValue} ${word.trim()}`;
}
static loadDropdown(dropdownName) {
dropdownName = dropdownName.toLowerCase();
const match = gl.FilteredSearchTokenKeys.get().filter(value => value.key === dropdownName)[0];
if (match) {
console.log(`🦄 load ${match.key} dropdown`);
}
}
bindEvents() {
const filteredSearchInput = document.querySelector('.filtered-search');