From: Paul L. <pa...@sq...> - 2005-04-17 01:13:27
|
Daniel W wrote: > Daniel Watts wrote: > >> This isn't a solution designed to allow selection above, below, of >> body text. This is a proposal to prevent the core code from tearing >> away focus on slower loading pages. >> >> Problem: >> ======== >> Not sure if you ever get this but sometimes you'll hit reply, click in >> the body and start typing. A second or two later the page will finish >> loading, the javascript onLoad will be executed and you'll find >> yourself finishing your sentence in the "To:" column. Very >> frustrating. No matter WHAT setting the user has set, this should >> never happen. >> >> >> Current Code (page_header.php) [line 168 in sm 1.4.4] >> ============================== >> "if( pos >= 0 ) {\n". >> "document.forms[i-1].elements[pos].focus();\n". >> "}\n". >> >> >> Proposal >> ======== >> Just change this to if (pos >= 0 && document.compose.body.focused=true) >> >> And add the focused setter to the textarea forum element: >> >> <TEXTAREA NAME=body ID=body ROWS=20 COLS="76" WRAP="VIRTUAL" >> onfocus="this.focused=true"> >> >> Actually, ideally this focused property would be added to ALL form >> elements in squirrelmail since if a user clicks on a form element it >> certainly means that they want that element to stay focused. >> >> Perhaps a global "onclick" can disable the entire focus code from >> running? On click sets the variable "userhasclicked" and the focus >> script checks this variable before actually actioning anything. This >> would be a sweet and simple solution. >> >> Yours, >> Daniel > > > Hi - any response to this one? It seems to work well for another form > that I use on my website (the login box) and i'm sure would work well > for the compose form etc... yes, yes. i am looking at adding it, you just need to have patience. -paul |