From a2e75c3ca4c3ceec41c6de05a8e11aac9b1ce3ff Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Wed, 6 Mar 2013 09:17:21 +0000 Subject: [PATCH] further work regarding the editor focus --- phpgwapi/inc/class.html.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 62ea43653a..3d79fffb27 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -570,7 +570,13 @@ class html r.collapse(true); r.selectNodeContents(d.getBody()); r.collapse('.($_focusToBody==='BOTTOM'?'false':'true').'); - r.select(); + r.select();'.($font_span?' + //this stuff is needed, as the above places the caret just before the span tag + var sN = r.startContainer.getNextSourceNode(); + //FF is selecting the span with getNextSourceNode, other browsers need to fetch it with getNext + r.selectNodeContents(((typeof sN.getName==="function") && sN.getName()=="span"?r.startContainer.getNextSourceNode():r.startContainer.getNextSourceNode().getNext())); + r.collapse(true); + r.select();':'').' ':''). ' ev.editor.resize("100%", '.str_replace('px', '', $pxheight).');