Skip to content

Commit

Permalink
Remove deprecated keypress
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Jan 13, 2025
1 parent 657c0da commit 342ea6c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,8 @@
});
//prevent posting form on pressing enter key
searchBox.keypress(function (e) {
var key = e.charCode || e.keyCode || 0;
if (key == 13) {
searchBox.keydown(function (e) {
if (e.key == 'Enter') {
return false;
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,8 @@ function initializeMediaApplication(displayMediaApplication, mediaApplicationUrl
}
});

$('#create-folder-name').keypress(function (e) {
var key = e.which;
if (key == 13) { // the enter key code
$('#create-folder-name').keydown(function (e) {
if (e.key == 'Enter') {
$('#modalFooterOk').click();
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1976,10 +1976,8 @@ function initializeMediaApplication(displayMediaApplication, mediaApplicationUrl
}
}
});
$('#create-folder-name').keypress(function (e) {
var key = e.which;
if (key == 13) {
// the enter key code
$('#create-folder-name').keydown(function (e) {
if (e.key == 'Enter') {
$('#modalFooterOk').click();
return false;
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@
var searchBox = $('#search-box');
// On Enter, edit the role if there is a single one
searchBox.keypress(function (event) {
if (event.which == 13) {
searchBox.keydown(function (e) {
if (e.key == 'Enter') {
// Edit the role if there is a single filtered element
var visible = $('.roles > ul > li:visible');
Expand Down

0 comments on commit 342ea6c

Please sign in to comment.