Skip to content

Commit

Permalink
Retain outputData during call to clearScreen (#1364)
Browse files Browse the repository at this point in the history
  • Loading branch information
KVonGit authored Jan 15, 2025
1 parent 10090ab commit c7754d9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion PlayerController/playercore.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,10 @@ function disableAllCommandLinks() {
});
}

// Modified by KV to handle the scrollback feature
var saveClearedText = false;
var clearedOnce = false;
function clearScreen() {
$("#outputData").appendTo($("body"));
if (!saveClearedText) {
$("#divOutput").css("min-height", 0);
$("#divOutput").html("");
Expand All @@ -784,12 +784,14 @@ function clearScreen() {
}
clearedOnce = true;
$('#divOutput').children().addClass('clearedScreen');
$('.clearedScreen').attr('id',null);
$('#divOutput').css('min-height', 0);
createNewDiv('left');
beginningOfCurrentTurnScrollPosition = 0;
setTimeout(function () {
$('html,body').scrollTop(0);
}, 100);
$("#outputData").appendTo($("#divOutput"));
}
}

Expand Down
4 changes: 3 additions & 1 deletion WebPlayer/playercore.js
Original file line number Diff line number Diff line change
Expand Up @@ -765,10 +765,10 @@ function disableAllCommandLinks() {
});
}

// Modified by KV to handle the scrollback feature
var saveClearedText = false;
var clearedOnce = false;
function clearScreen() {
$("#outputData").appendTo($("body"));
if (!saveClearedText) {
$("#divOutput").css("min-height", 0);
$("#divOutput").html("");
Expand All @@ -784,12 +784,14 @@ function clearScreen() {
}
clearedOnce = true;
$('#divOutput').children().addClass('clearedScreen');
$('.clearedScreen').attr('id',null);
$('#divOutput').css('min-height', 0);
createNewDiv('left');
beginningOfCurrentTurnScrollPosition = 0;
setTimeout(function () {
$('html,body').scrollTop(0);
}, 100);
$("#outputData").appendTo($("#divOutput"));
}
}

Expand Down

0 comments on commit c7754d9

Please sign in to comment.