aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript/core.js
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2014-06-13 12:10:38 +0100
committerbrunoais <brunoaiss@gmail.com>2014-06-17 17:07:32 +0100
commite1b72c0b8637159cc598530440f6acd5fabc26a1 (patch)
tree66fd9c2c19608b3f8330955f146aad8083f75368 /phpBB/assets/javascript/core.js
parent2c70cec4fb641fa2f6e7d37be706e38e2697939b (diff)
downloadforums-e1b72c0b8637159cc598530440f6acd5fabc26a1.tar
forums-e1b72c0b8637159cc598530440f6acd5fabc26a1.tar.gz
forums-e1b72c0b8637159cc598530440f6acd5fabc26a1.tar.bz2
forums-e1b72c0b8637159cc598530440f6acd5fabc26a1.tar.xz
forums-e1b72c0b8637159cc598530440f6acd5fabc26a1.zip
[ticket/12699] Replace magic numbers for the TAB and for ENTER keydown
Replaced the magic numbers 9 and 13 in the keydown for the text editor with constants in the existing keymap for phpBB. PHPBB3-12699
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r--phpBB/assets/javascript/core.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index a70e6b3e9a..80c44ec08f 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -1202,10 +1202,10 @@ phpbb.applyCodeEditor = function(textarea) {
var key = event.keyCode || event.which;
// intercept tabs
- if (key == 9 &&
- !event.ctrlKey &&
- !event.shiftKey &&
- !event.altKey &&
+ if (key == keymap.TAB &&
+ !event.ctrlKey &&
+ !event.shiftKey &&
+ !event.altKey &&
!event.metaKey) {
if (inTag()) {
appendText("\t");
@@ -1215,7 +1215,7 @@ phpbb.applyCodeEditor = function(textarea) {
}
// intercept new line characters
- if (key == 13) {
+ if (key == keymap.ENTER) {
if (inTag()) {
var lastLine = getLastLine(true),
code = '' + /^\s*/g.exec(lastLine);