From: Michael M Slusarz Date: Wed, 14 Oct 2009 17:50:27 +0000 (-0600) Subject: Scroll compose screen to cursor position on non IE-browser (works at least with FF... X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=d2d89146333e3f82e4e203d33f3efbc65924c746;p=horde.git Scroll compose screen to cursor position on non IE-browser (works at least with FF 3.5) --- diff --git a/imp/js/compose-dimp.js b/imp/js/compose-dimp.js index 5fe9c2e54..e719a188e 100644 --- a/imp/js/compose-dimp.js +++ b/imp/js/compose-dimp.js @@ -642,6 +642,9 @@ var DimpCompose = { /* This works in Mozilla */ Field.focus(input); input.setSelectionRange(pos, pos); + if (pos) { + (function() { input.scrollTop = input.scrollHeight - input.offsetHeight; }).defer(); + } } else if (input.createTextRange) { /* This works in IE */ range = input.createTextRange(); diff --git a/imp/js/compose.js b/imp/js/compose.js index 2908b917a..f1de0af67 100644 --- a/imp/js/compose.js +++ b/imp/js/compose.js @@ -39,6 +39,9 @@ var ImpCompose = { /* This works in Mozilla */ Field.focus(input); input.setSelectionRange(position, position); + if (position) { + (function() { input.scrollTop = input.scrollHeight - input.offsetHeight; }).defer(); + } } else if (input.createTextRange) { /* This works in IE */ var range = input.createTextRange();