mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-04 07:47:34 +02:00
[ticket/10270] Added keyboard shortcuts to confirm and alert boxes.
PHPBB3-10270
This commit is contained in:
committed by
Igor Wiedler
parent
59031fdc73
commit
69eb7b8332
@@ -70,6 +70,14 @@ phpbb.alert = function(title, msg, fadedark) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).bind('keydown', function(e) {
|
||||||
|
if (e.keyCode === 13 || e.keyCode === 27) {
|
||||||
|
$(dark).trigger('click');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
if (loading_alert.is(':visible'))
|
if (loading_alert.is(':visible'))
|
||||||
{
|
{
|
||||||
loading_alert.fadeOut(function() {
|
loading_alert.fadeOut(function() {
|
||||||
@@ -118,6 +126,17 @@ phpbb.confirm = function(msg, callback, fadedark) {
|
|||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(document).bind('keydown', function(e) {
|
||||||
|
if (e.keyCode === 13) {
|
||||||
|
$('.jalertbut.button1').trigger('click');
|
||||||
|
return false;
|
||||||
|
} else if (e.keyCode === 27) {
|
||||||
|
$('.jalertbut.button2').trigger('click');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
if (loading_alert.is(':visible'))
|
if (loading_alert.is(':visible'))
|
||||||
{
|
{
|
||||||
loading_alert.fadeOut(function() {
|
loading_alert.fadeOut(function() {
|
||||||
|
Reference in New Issue
Block a user