diff --git a/src/js/commandline.js b/src/js/commandline.js
index d887336d0..21c031bc7 100644
--- a/src/js/commandline.js
+++ b/src/js/commandline.js
@@ -2023,14 +2023,15 @@ function updateSuggestedCommands() {
function displayFoundCommands() {
$("#commandLine .suggestions").empty();
+ let commandsHTML = "";
let list = currentCommands[currentCommands.length - 1];
$.each(list.list, (index, obj) => {
if (obj.found && (obj.available !== undefined ? obj.available() : true)) {
- $("#commandLine .suggestions").append(
- '
' + obj.display + "
"
- );
+ commandsHTML +=
+ '' + obj.display + "
";
}
});
+ $("#commandLine .suggestions").html(commandsHTML);
if ($("#commandLine .suggestions .entry").length == 0) {
$("#commandLine .separator").css({ height: 0, margin: 0 });
} else {
diff --git a/src/js/script.js b/src/js/script.js
index 7b9758415..e4ea78ec9 100644
--- a/src/js/script.js
+++ b/src/js/script.js
@@ -857,14 +857,15 @@ function addWord() {
function showWords() {
$("#words").empty();
+ let wordsHTML = "";
for (let i = 0; i < wordsList.length; i++) {
- let w = "";
+ wordsHTML += "
";
for (let c = 0; c < wordsList[i].length; c++) {
- w += "" + wordsList[i].charAt(c) + "";
+ wordsHTML += "" + wordsList[i].charAt(c) + "";
}
- w += "
";
- $("#words").append(w);
+ wordsHTML += "
";
}
+ $("#words").html(wordsHTML);
$("#wordsWrapper").removeClass("hidden");
const wordHeight = $(document.querySelector(".word")).outerHeight(true);
@@ -3119,6 +3120,7 @@ function toggleResultWordsDisplay() {
async function loadWordsHistory() {
$("#resultWordsHistory .words").empty();
+ let wordsHTML = "";
for (let i = 0; i < inputHistory.length + 2; i++) {
let input = inputHistory[i];
let wordEl = "";
@@ -3229,8 +3231,9 @@ async function loadWordsHistory() {
wordEl += "";
} catch (e) {}
}
- $("#resultWordsHistory .words").append(wordEl);
+ wordsHTML += wordEl;
}
+ $("#resultWordsHistory .words").html(wordsHTML);
$("#showWordHistoryButton").addClass("loaded");
return true;
}