?

On Aug 27, 4:32 am, Robert Katić <robert.ka...@gmail.com> wrote:
> I suppose it is rear to use multiple namespaces to unbind aneventand
> that it is the reason why no one spotted this bug (I spotted it by
> examining code, not by using the feature).
>
> This is the problem:
>
> $("div").bind("click.aaa.bbb", function(){...});
>
> $("div").unbind("click.a.bbb"); //this is unbinding the previous
> bind!!!
>
> Now someone would suppose: "Well it seams fine, there is .bbb so it
> will unbind click.aaa.bbb too", but it is not true:
>
> $("div").unbind("click.bbb.other") // will not unbind click.aaa.bbb
>
> The problem seams to be the generated regexp intoevent.remove() 
> andevent.handle():
>
> var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\
> \.") + "(\\.|$)");
>
> that for me would be:
>
> var namespace = RegExp("(^|\\.)" + namespaces.slice().sort().join("\\.
> (?:.*\\.)?") + "(\\.|$)");
>
> Am I missing something here?
>
> Here is a test-casehttp://jsbin.com/aledo
> And here is the same case with the correctedevent.remove() 
> function:http://jsbin.com/eqofo
> (I hope jsbin.com has no problems any more)
>
> Will I open a ticket?
--~--~---------~--~----~------------~-------~--~----~
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@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to