master
Aevann1 2022-08-11 19:01:44 +02:00
parent 8de09d8a9d
commit 3daab0586b
1 changed files with 10 additions and 10 deletions

View File

@ -409,7 +409,7 @@ function emojiAddToInput(event)
let e let e
let current_word = ""; let current_word = "";
let emojo_index = 0; let emoji_index = 0;
function curr_word_is_emoji() function curr_word_is_emoji()
{ {
@ -425,7 +425,7 @@ function emojiAddToInput(event)
return -1; return -1;
} }
emojo_index = 0; emoji_index = 0;
speed_carot_modal.innerHTML = ""; speed_carot_modal.innerHTML = "";
const MAXXX = 25; const MAXXX = 25;
// Not sure why the results is a Set... but oh well // Not sure why the results is a Set... but oh well
@ -512,29 +512,29 @@ function emojiAddToInput(event)
// Up or down arrow or enter // Up or down arrow or enter
if (e.keyCode == 38 || e.keyCode == 40 || e.keyCode == 13) if (e.keyCode == 38 || e.keyCode == 40 || e.keyCode == 13)
{ {
if (emojo_index > select_items.length) if (emoji_index > select_items.length)
emojo_index = select_items; emoji_index = select_items;
select_items[emojo_index].classList.remove("selected"); select_items[emoji_index].classList.remove("selected");
switch (e.keyCode) switch (e.keyCode)
{ {
case 38: // Up arrow case 38: // Up arrow
if (emojo_index) if (emoji_index)
emojo_index--; emoji_index--;
break; break;
case 40: // Down arrow case 40: // Down arrow
if (emojo_index < select_items.length-1) emojo_index++; if (emoji_index < select_items.length-1) emoji_index++;
break; break;
case 13: case 13:
select_items[emojo_index].click(); select_items[emoji_index].click();
default: default:
break; break;
} }
select_items[emojo_index].classList.add("selected"); select_items[emoji_index].classList.add("selected");
e.preventDefault(); e.preventDefault();
} }
} }