Rework selectOnClick code to get it working again.  The trick is getting it to only select all the text on the first click.  (Otherwise there would be no way to deselect the text.)
Rework selectOnClick code to get it working again.  The trick is getting it to only select all the text on the first click.  (Otherwise there would be no way to deselect the text.)

Since mousedown on a blurred field focuses it, it's tricky timing detecting when the mousedown causes focus versus when the field was already focused.  (Plus detecting when a focus event was caused by tabbing into the field.)   Note that the order of onmousedown and onfocus varies between IE and FF.

Seems possible to detect it though, in focus.js, after [20662].  So added a flag to _onFocus() callback that tells whether focus was caused by mousedown ("mouse") or not.  (Using a string flag for possible future expansion via touch events etc.)

Fixes #10417, refs #10208, #8187 !strict.

git-svn-id: 674a2d6b1e32e53f607eb824547723f32280967e@20920 560b804f-0ae3-0310-86f3-f6aa0a117693

harbalk/delite,harbalk/delite,kitsonk/delite,kitsonk/delite,Sam-Cummins/delite,Sam-Cummins/delite