aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2015-08-08 15:31:40 +0200
committerMarc Alexander <admin@m-a-styles.de>2015-08-17 15:25:13 +0200
commit452b3b4890b161b3dc030f8f5940df1838ec5ad0 (patch)
treed4023a23a95d2f9ee34657e37ebe293754b9d7e5
parent4aac578908b5bd2d1e176172b37c72828022f460 (diff)
downloadforums-452b3b4890b161b3dc030f8f5940df1838ec5ad0.tar
forums-452b3b4890b161b3dc030f8f5940df1838ec5ad0.tar.gz
forums-452b3b4890b161b3dc030f8f5940df1838ec5ad0.tar.bz2
forums-452b3b4890b161b3dc030f8f5940df1838ec5ad0.tar.xz
forums-452b3b4890b161b3dc030f8f5940df1838ec5ad0.zip
[ticket/14077] Fall back to 1 as focusOffset if length is unsupported
The setBaseAndExtent() in Microsoft's Edge browser is incompatible with the one Webkit browsers use. As a result of that, we have to fall back to setting the focusOffset to 1 instead of the text length. PHPBB3-14077
-rw-r--r--phpBB/styles/prosilver/template/forum_fn.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/phpBB/styles/prosilver/template/forum_fn.js b/phpBB/styles/prosilver/template/forum_fn.js
index 0d53a53d8e..8e5b257ba4 100644
--- a/phpBB/styles/prosilver/template/forum_fn.js
+++ b/phpBB/styles/prosilver/template/forum_fn.js
@@ -156,7 +156,11 @@ function selectCode(a) {
// Safari and Chrome
if (s.setBaseAndExtent) {
var l = (e.innerText.length > 1) ? e.innerText.length - 1 : 1;
- s.setBaseAndExtent(e, 0, e, l);
+ try {
+ s.setBaseAndExtent(e, 0, e, l);
+ } catch (error) {
+ s.setBaseAndExtent(e, 0, e, 1);
+ }
}
// Firefox and Opera
else {