Bring highlighting back.

Fix backgroundMagic using output result instead of dish value
This commit is contained in:
j433866 2019-05-07 14:20:18 +01:00
parent f1a2cf7efc
commit 35d6c7d79e
5 changed files with 86 additions and 23 deletions

View file

@ -504,6 +504,9 @@ class InputWaiter {
const fileOverlay = document.getElementById("input-file");
if (fileOverlay.style.display === "block") return;
// Remove highlighting from input and output panes as the offsets might be different now
this.manager.highlighter.removeHighlights();
const textArea = document.getElementById("input-text");
const value = (textArea.value !== undefined) ? textArea.value : "";
const activeTab = this.getActiveTab();
@ -857,6 +860,10 @@ class InputWaiter {
*/
changeTab(inputNum, changeOutput) {
const tabsList = document.getElementById("input-tabs");
this.manager.highlighter.removeHighlights();
getSelection().removeAllRanges();
let found = false;
let minNum = Number.MAX_SAFE_INTEGER;
for (let i = 0; i < tabsList.children.length; i++) {
@ -985,6 +992,9 @@ class InputWaiter {
this.manager.worker.cancelBake();
this.manager.output.removeAllOutputs();
this.manager.highlighter.removeHighlights();
getSelection().removeAllRanges();
const tabsList = document.getElementById("input-tabs").children;
for (let i = tabsList.length - 1; i >= 0; i--) {
tabsList.item(i).remove();
@ -1002,6 +1012,9 @@ class InputWaiter {
const inputNum = this.getActiveTab();
if (inputNum === -1) return;
this.manager.highlighter.removeHighlights();
getSelection().removeAllRanges();
this.updateInputValue(inputNum, "");
this.set({