From 714140838b2a5b7b78679a309242d7a38ed7460b Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 9 Apr 2019 12:56:34 +0200 Subject: [PATCH] fix terminal filtering --- src/app/panels/terminal.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/app/panels/terminal.js b/src/app/panels/terminal.js index 2fef8f1db0..b881d88ab8 100644 --- a/src/app/panels/terminal.js +++ b/src/app/panels/terminal.js @@ -132,6 +132,7 @@ class Terminal {
` self._view.dropdown = self._components.dropdown.render() self._view.pendingTxCount = yo`
0
` + self._view.inputSearch = yo`` self._view.bar = yo`
${self._view.dragbar} @@ -151,7 +152,7 @@ class Terminal { ${self._view.dropdown}
- + ${self._view.inputSearch}
@@ -280,7 +281,7 @@ class Terminal { if (inserted) { text.innerText = '' background.onclick = undefined - self._view.journal.removeChild(placeholder) + if (placeholder.parentElement) self._view.journal.removeChild(placeholder) } inserted = false delete self.scroll2bottom @@ -347,7 +348,7 @@ class Terminal { clearTimeout(filtertimeout) } filtertimeout = setTimeout(() => { - self.updateJournal({ type: 'search', value: document.querySelector('.' + event.target.className).value }) + self.updateJournal({ type: 'search', value: self._view.inputSearch.value }) }, 500) } function clear (event) { @@ -499,8 +500,8 @@ class Terminal { commands[value] = false if (!self._INDEX.commandsMain[value]) return self._INDEX.commandsMain[value].forEach(item => { - item.root.steps.forEach(item => { self._JOURNAL[item.gidx] = undefined }) - self._JOURNAL[item.gidx] = undefined + item.root.steps.forEach(item => { self._JOURNAL[item.gidx].hide = true }) + self._JOURNAL[item.gidx].hide = true }) } else if (filterEvent.type === 'search') { if (value !== self.data.activeFilters.input) { @@ -535,7 +536,7 @@ class Terminal { self._jobs = [] }) } - self._jobs.push(el) + if (self.data.activeFilters.commands[item.cmd]) self._jobs.push(el) } scroll2bottom () { var self = this