[Laszlo-dev] What was the reason for setting document.onselectstart in LzInputTextSprite?
Max Carlson
max at laszlosystems.com
Tue Jun 2 11:53:24 PDT 2009
Also see LPP-4170 - Edittext does not allow mouse to highlight entered
text in dhtml.
Henry, here's how I found these:
$ svn blame LzInputTextSprite.js | grep onselectstart
6826 max document.onselectstart = null;
13912 pbr document.onselectstart =
LzTextSprite.prototype.__cancelhandler;
7295 max document.onselectstart =
LzTextSprite.prototype.__cancelhandler;
Of course that only shows the most recent change for those lines - I
searched my checkin history and it looks like the original change was
from r1035(!):
Turn off text selection in OE[sic] DHTML - fixes dragging in LzPix
promanik at laszlosystems.com wrote:
> This dates back to LPP-4715.
>
>
>
> On Tue, Jun 2, 2009 at 9:57 AM , Henry Minsky wrote:
>
> There's some code in the kernel DHTML LzInputTextSprite which globally
> disables the onselectstart
>
> // prevent text selection in IE
> // can't use lz.embed.attachEventHandler because we need to cancel events
> document.onselectstart = LzTextSprite.prototype.__cancelhandler;
> document.ondrag = LzTextSprite.prototype.__cancelhandler;
>
> What was the need for that? Why wasn't it sufficient to rely on the
> LzTextSprite.setSelectable behavior
> (which sets this.__LZdiv.onselectstart =
> LzTextSprite.prototype.__cancelhandler )? Or was this
> to fix some other issue besides toggling (input) text selectability?
>
>
>
> --
> Henry Minsky
> Software Architect
> _hminsky at laszlosystems.com_ <mailto:hminsky at laszlosystems.com>
>
>
--
Regards,
Max Carlson
OpenLaszlo.org
More information about the Laszlo-dev
mailing list