Resolve MR review suggestions

This commit is contained in:
Clement Ho 2016-11-14 10:37:55 -06:00
parent 7f4609198d
commit 01eb0571f0
3 changed files with 15 additions and 21 deletions

View file

@ -1,4 +1,3 @@
/* 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 @@
// the compiled file. // the compiled file.
// //
/*= require_tree . */ /*= require_tree . */
(function() {
}).call(this);

View file

@ -18,22 +18,22 @@
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) {
clearSearchButton.classList.remove('hidden'); clearSearchButton.classList.remove('hidden');
} else { } else {
clearSearchButton.classList.add('hidden'); clearSearchButton.classList.add('hidden');
} }
} }
function loadSearchParamsFromURL() { function loadSearchParamsFromURL() {
@ -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();
} }
} }

View file

@ -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