assetflow/static/js/searchBox.js

12 lines
350 B
JavaScript
Raw Normal View History

document.getElementById("SearchBox").addEventListener("keyup", handleSearchChange);
function handleSearchChange(e) {
console.log(e.target.value);
// Check if known prefix is used (either > or #)
if (e.target.value[0] == ">") {
// Search for commands
} else if (e.target.value[0] == "#") {
// Search for SKU
} else {
// Search for name
}
}