UJS and nested constructions
Reported by MadRabbit | October 22nd, 2010 @ 04:07 PM | in 2.2.0 Release
The story goes like that, when you have an elements kinda like that
<div class="one">
one text
<div class="two">
second text
<div class="three">
third text
</div>
</div>
</div>
And when we hook up the first div with UJS
"div.one".onClick(function() {
console.log(this.getClass());
});
It works only if you click on the div.one
itself
and doesn't if you click on inner elements. Which is kinda annoying
and a bit unexpected, because when you hook events directly to an
element, all the inner element clicks bubble and got caught at the
basic element level.
So we need kinda investigate what what. I think that would be a good idea if UJS in RightJS will work with nested elements the same way as it does with normal elements, be we need to check if we won't screw people over with such a change and plus we need to check how fast it is, because in current implementation we match the target element only, but if we go with nested ones as well, then we will have to check all the parent elements as well which might get pretty slow.
Comments and changes to this ticket
-
MadRabbit January 8th, 2011 @ 07:47 PM
- State changed from new to resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
RightJS Core Tickets