jQuery: The Write Less, Do More JavaScript Library

 « Return to Thread: Event.fix optimisation

Re: Event.fix optimisation

by Diego A. :: Rate this Message:

Reply to Author | View in Thread


Hi Diego, (hope you're still monitoring this thread)

I found a problem. jQuery.ui.slider does not work with your patch.
This is beyond my understand of jQuery's event handling, but I believe
the problem is happening because of lines like this:

$(element).bind("setData.slider", function(event, key, value){

I don't understand the purpose of the periods in the event ID and how
jQuery uses it, but it seems to be the cause of the problem in your
patch.

The question is, is this complex event handling actually necessary?
Any ideas?

Cheers,
Diego A.

On Apr 16, 2:07 pm, "Diego A." <diego.a...@...> wrote:

> Hi Diego,
>
> The fix works perfectly now. Massive improvement!
> I hope it makes its way into the next jQuery release...
>
> Thanks for all your work!
>
> Diego A.
>
> On Apr 13, 11:57 pm, Diego Perini <diego.per...@...> wrote:
>
> > Diego A.,
> > you are correct...I forgot the "special" "custom" event... :-)
>
> > There are probably a couple of ways to solve this long puzzle,
> > the first is easy and hope finally backward compatible with
> > existing code; remove the following conditional lines so
> > the contained block is always executed:
>
> >    // is it a custom event
> >    if ( !ev.initEvent ) {
> > ...
> >    }
>
> > Above code start around line 2220 in the patched jQuery source.
>
> > This will decrease a bit in performances for every other type of
> > event on every browser but IE (event properties are writable).
>
> > That code block is what makes the event object writable on other
> > browsers different from IE, the conditional around it was put in
> > place to only do this when dealing with custom events,
> > but special events are still another case (similar...).
>
> > I will do my best to setup a new patch with that correction.
>
> > I am currently closing a long waiting work and not too much
> > time left. Thank you for reviving this out of that long thread.
>
> > Diego Perini
>
> > On 12 Apr, 16:57, "Diego A." <diego.a...@...> wrote:
>
> > > Continued from:http://groups.google.com/group/jquery-dev/browse_frm/thread/8cce225d1...
>
> > > Hi Diego (Perini),
>
> > > I've been away for a few days, and now I've tested the latest version
> > > of your patch, I still get an error with the TreeView plugin. I don't
> > > know if it's something the TreeView plugin.
>
> > > I've setup a test here:http://www.fyneworks.com/jquery/event.fix/DiegoPerini/readOnlyProperty/
>
> > > The error messages are:
>
> > > (line 2315) setting a property that has only a getter
> > > [Break on this error] arguments[0].type = "mouseleave";
>
> > > (line 2293) setting a property that has only a getter
> > > [Break on this error] arguments[0].type = "mouseenter";
>
> > > As far as I can see, the problem originates from the use of the .hover
> > > function, which in turn uses the special jQuery mouseenter /
> > > mouseleave events. I found some information about them here:http://jquery.com/blog/2008/01/15/jquery-122-2nd-birthday-present/
>
> > > I hope this helps.
>
> > > Diego A.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "jQuery Development" group.
To post to this group, send email to jquery-dev@...
To unsubscribe from this group, send email to jquery-dev-unsubscribe@...
For more options, visit this group at http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

 « Return to Thread: Event.fix optimisation