Skip to content

Commit

Permalink
Remove deprecated keypress usage (OrchardCMS#17344)
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco authored Jan 14, 2025
1 parent c42af0f commit 0042306
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
var $displayName = $("#@Html.IdFor(m => m.DisplayName)");
var nameAltered;
$name.keypress(function () {
$name.keydown(function () {
nameAltered = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
var $displayName = $("#@Html.IdFor(m => m.DisplayName)");
var nameAltered;
$name.keypress(function () {
$name.keydown(function () {
nameAltered = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
var $displayName = $("#@Html.IdFor(m => m.DisplayName)");
var nameAltered;
$name.keypress(function () {
$name.keydown(function () {
nameAltered = true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ var corsApp = new Vue({
var searchBox = $('#search-box');

// On Enter, edit the item if there is a single one
searchBox.keypress(function (event) {
if (event.which == 13) {
searchBox.keydown(function (e) {
if (e.key == 'Enter') {

// Edit the item if there is a single filtered element
var visible = $('#corsAdmin > ul > li:visible');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ var corsApp = new Vue({
var searchBox = $('#search-box');

// On Enter, edit the item if there is a single one
searchBox.keypress(function (event) {
if (event.which == 13) {
searchBox.keydown(function (e) {
if (e.key == 'Enter') {
// Edit the item if there is a single filtered element
var visible = $('#corsAdmin > ul > li:visible');
if (visible.length == 1) {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 0042306

Please sign in to comment.