mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
Merge pull request #3818 from marc1706/ticket/14077
[ticket/14077] Fall back to 1 as focusOffset if length is unsupported * marc1706/ticket/14077: [ticket/14077] Fall back to 1 as focusOffset if length is unsupported
This commit is contained in:
commit
19267242e3
1 changed files with 5 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue