diff options
author | Matt Friedman <maf675@gmail.com> | 2014-04-05 15:05:02 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2014-04-05 15:05:02 -0700 |
commit | 7e6d6a6be64d10d974678b4c33d5695049a56887 (patch) | |
tree | 8dfbbfdccac93bf370a9f039ad656641697bb953 | |
parent | d0aa7c6455170396fd8b6c9add7cf2a19bb17426 (diff) | |
download | forums-7e6d6a6be64d10d974678b4c33d5695049a56887.tar forums-7e6d6a6be64d10d974678b4c33d5695049a56887.tar.gz forums-7e6d6a6be64d10d974678b4c33d5695049a56887.tar.bz2 forums-7e6d6a6be64d10d974678b4c33d5695049a56887.tar.xz forums-7e6d6a6be64d10d974678b4c33d5695049a56887.zip |
[ticket/12083] Fix Select All in CODE bbcode with only one char
PHPBB3-12083
-rw-r--r-- | phpBB/styles/prosilver/template/forum_fn.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js index de51b54e9b..56dfcb04c7 100644 --- a/phpBB/styles/prosilver/template/forum_fn.js +++ b/phpBB/styles/prosilver/template/forum_fn.js @@ -184,9 +184,10 @@ function selectCode(a) { // Not IE and IE9+ if (window.getSelection) { s = window.getSelection(); - // Safari + // Safari and Chrome if (s.setBaseAndExtent) { - s.setBaseAndExtent(e, 0, e, e.innerText.length - 1); + var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1; + s.setBaseAndExtent(e, 0, e, l); } // Firefox and Opera else { |