Scroll compose screen to cursor position on non IE-browser (works at least with FF...
authorMichael M Slusarz <slusarz@curecanti.org>
Wed, 14 Oct 2009 17:50:27 +0000 (11:50 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Wed, 14 Oct 2009 18:01:47 +0000 (12:01 -0600)
imp/js/compose-dimp.js
imp/js/compose.js

index 5fe9c2e..e719a18 100644 (file)
@@ -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();
index 2908b91..f1de0af 100644 (file)
@@ -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();