P T Withington wrote:
On 2009-07-22, at 17:46EDT, Max Carlson wrote:

P T Withington wrote:
[[#LPP-5447] DHTML: inputtext and clickable - OpenLaszlo Jira](http://jira.openlaszlo.org/jira/browse/LPP-5447) What is the difference between LzInputTextSprite/__setglobalclickable and LzMouseKernel.setGlobalClickable? In particular, the latter just turns off the whole click tree by hiding the root of the tree (which seems should be pretty efficient) and the latter turns off only divs that have the class `lzclickdiv` by modifying the CSS style rule associated with that class (which seems might be more expensive). Why the two different methods?

LzInputTextSprite/__setglobalclickable() is used by inputtexts to disable clickable. Since inputtexts currently bind into the click div (see LzInputTextSprite.__show) the clickdiv itself can't be hidden - or else the inputtext would be hidden also.

Aha! But if we don't reparent the input text (the current proposed solution), we can dispense with that, and just use the more efficient mechanism of turning off the tree at the root.

'xactly.

LzMouseKernel.setGlobalClickable() is used by the html tag to disable the click tree so it doesn't interfere with an iframe's.

Can you explain the purpose of __lastShown, __focusedSprite, and __lastfocus? I can't follow what these are trying to do.

__lastshown tracks the last inputtext to be shown by __show(), and is used to hide the currently showing inputtext. __focusedSprite tracks the last inputtext to be focused, and is used to work around bugs in firefox's focus management and prevent spurious/extra onfocus/blur events from being sent. __lastfocus holds a reference to the last inputtext to be selected - by select() or setSelection(). It's used as a callback (see setTimout()) to work around a bug in IE where a field can't be selected immediately after it's focused.

Complicated, no? Since you're in there, can you please add these notes as comments? Thanks!

Yes, but I'm thinking some of this will go away if we don't have to reparent the inputtext element into the click tree. Which makes me wonder why we were doing that in the first place? Are we going to break something else by not reparenting?

If I understand correctly, all the show/hide/focus stuff has to do with the input element not being where it would normally be. If we just leave it be, will we still need all these?

I'm hoping we won't need them anymore. Let's get the reparenting fix done, then clean up after that. At this point, they're used in other places - see LzSprite and LzMouseKernel...

--
Regards,
Max Carlson
OpenLaszlo.org

Reply via email to