提交 01eb0571 编写于 作者: C Clement Ho

Resolve MR review suggestions

上级 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,22 +18,22 @@
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) {
clearSearchButton.classList.remove('hidden');
} else {
clearSearchButton.classList.add('hidden');
}
clearSearchButton.classList.remove('hidden');
} else {
clearSearchButton.classList.add('hidden');
}
}
function loadSearchParamsFromURL() {
......@@ -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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册