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