Skip to content

Commit

Permalink
fix(JS): migrate deprecated .charCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotzbua committed Oct 17, 2024
1 parent 30f35a1 commit fec50b3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/typescript/frontend/LineNumberHighlighting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ export class LineNumberHighlighting {
let $panel = $(".gotoLineNumerPanel"),
$lineInput = $panel.find("input[name=lineNumber]"),
panelIsOpen = false;
window.addEventListener('keypress', (ev) => {
if (!panelIsOpen && ev.charCode >= 48 && ev.charCode <= 57) {
window.addEventListener('keydown', (ev) => {
if (!panelIsOpen && ev.key >= '0' && ev.key <= '9') {
let $target = $(ev.target);
if ($target.is('input, textarea, div.texteditor, .cke_editable') || $target.parents('input, textarea, div.texteditor, .cke_editable').length > 0) {
// Typing in an input field, like comments
Expand Down

0 comments on commit fec50b3

Please sign in to comment.