Skip to content

Commit

Permalink
LEAF 4597 only show card keyboard info when using keyboard to move
Browse files Browse the repository at this point in the history
  • Loading branch information
aerinkayne committed Dec 12, 2024
1 parent a6f4083 commit a61bc05
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions LEAF_Nexus/templates/editor.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,17 @@ function moveCoordinates(prefix, position) {
return;
} else if (controlKeys.includes(e.key)) {
e.preventDefault();
//only show extra info if keyboard is being used to move the card
if(['ArrowLeft', 'ArrowRight', 'ArrowUp', 'ArrowDown'].includes(e.key)) {
if( $('#visual_alert_box_container label').hasClass('hide')) {
$('#visual_alert_box_container label').removeClass('hide');
$('#visual_alert_box').removeClass('hide');
} else {
if(document.getElementById('MovementInfoToggle').checked !== true) {
$('#visual_alert_box').removeClass('hide');
}
}
}
switch (e.key) {
case "ArrowLeft":
leftValue = (Number(leftValue) - 10);
Expand Down Expand Up @@ -333,14 +344,6 @@ function moveCoordinates(prefix, position) {
let title = document.getElementById(prefix + position + '_title');
let titleText = title.innerHTML;
alert_box_card_title.textContent = titleText;
if( $('#visual_alert_box_container label').hasClass('hide')) {
$('#visual_alert_box_container label').removeClass('hide');
$('#visual_alert_box').removeClass('hide');
} else {
if(document.getElementById('MovementInfoToggle').checked !== true) {
$('#visual_alert_box').removeClass('hide');
}
}
let card = document.getElementById(prefix + position);
let cardStyle = window.getComputedStyle(card);
Expand Down

0 comments on commit a61bc05

Please sign in to comment.