Commit 01eb0571 authored by Clement Ho's avatar Clement Ho

Resolve MR review suggestions

parent 7f460919
/* eslint-disable */
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
......@@ -6,8 +5,3 @@
// the compiled file.
//
/*= require_tree . */
(function() {
}).call(this);
\ No newline at end of file
......@@ -18,15 +18,15 @@
param: 'name[]',
}];
function clearSearch(event) {
event.stopPropagation();
event.preventDefault();
function clearSearch(e) {
e.stopPropagation();
e.preventDefault();
document.querySelector('.filtered-search').value = '';
document.querySelector('.clear-search').classList.add('hidden');
}
function toggleClearSearchButton(event) {
function toggleClearSearchButton(e) {
const clearSearchButton = document.querySelector('.clear-search');
if (event.target.value) {
......@@ -97,16 +97,16 @@
document.querySelector('.clear-search').addEventListener('click', clearSearch);
}
processInput(event) {
const input = event.target.value;
processInput(e) {
const input = e.target.value;
this.tokenizer.processTokens(input);
}
checkForEnter(event) {
checkForEnter(e) {
// Enter KeyCode
if (event.keyCode === 13) {
event.stopPropagation();
event.preventDefault();
if (e.keyCode === 13) {
e.stopPropagation();
e.preventDefault();
this.search();
}
}
......
......@@ -36,7 +36,7 @@
inputs.forEach((i) => {
if (incompleteToken) {
const prevToken = this.tokens[this.tokens.length - 1];
const prevToken = this.tokens.last();
prevToken.value += ` ${i}`;
// Remove last quotation
......
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