git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@14824
7612ce4b-ef26-0410-bec9-
ea0150e637f0
}
var alreadyFocused = false;
}
var alreadyFocused = false;
+
+function cursorToTop(element) {
+ if (typeof element.selectionStart == 'number')
+ element.selectionStart = element.selectionEnd = 0;
+ else if (typeof element.createTextRange != 'undefined') {
+ var selectionRange = element.createTextRange();
+ selectionRange.moveStart('character', 0);
+ selectionRange.select();
+ }
+}
+
function checkForm(smaction) {
if (alreadyFocused) return;
function checkForm(smaction) {
if (alreadyFocused) return;
document.forms['compose'].body.select();
} else if (smaction == "focus") {
document.forms['compose'].body.focus();
document.forms['compose'].body.select();
} else if (smaction == "focus") {
document.forms['compose'].body.focus();
+ cursorToTop(document.forms['compose'].body);