diff options
| author | Callum Macrae <callum@lynxphp.com> | 2011-08-18 19:02:18 +0100 |
|---|---|---|
| committer | Igor Wiedler <igor@wiedler.ch> | 2012-03-31 02:09:13 +0200 |
| commit | 69eb7b83322070162c6161ab1791fea1a2abd128 (patch) | |
| tree | 2456f8ddd2724e94084395c93d56dd1fba0b53cc /phpBB/styles/script.js | |
| parent | 59031fdc735a80502ea2cda3683a9276da5649cd (diff) | |
| download | forums-69eb7b83322070162c6161ab1791fea1a2abd128.tar forums-69eb7b83322070162c6161ab1791fea1a2abd128.tar.gz forums-69eb7b83322070162c6161ab1791fea1a2abd128.tar.bz2 forums-69eb7b83322070162c6161ab1791fea1a2abd128.tar.xz forums-69eb7b83322070162c6161ab1791fea1a2abd128.zip | |
[ticket/10270] Added keyboard shortcuts to confirm and alert boxes.
PHPBB3-10270
Diffstat (limited to 'phpBB/styles/script.js')
| -rw-r--r-- | phpBB/styles/script.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/phpBB/styles/script.js b/phpBB/styles/script.js index d17a2cdc10..54248cc31c 100644 --- a/phpBB/styles/script.js +++ b/phpBB/styles/script.js @@ -69,6 +69,14 @@ phpbb.alert = function(title, msg, fadedark) { }); 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')) { @@ -118,6 +126,17 @@ phpbb.confirm = function(msg, callback, fadedark) { 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')) { loading_alert.fadeOut(function() { |
