int etype = getTypeInt(event.getType());
String originalEventType = GqEvent.getOriginalEventType(event);
- for (int i = 0; i < elementEvents.length(); i++) {
+ for (int i = 0, l = elementEvents.length(); i < l; i++) {
BindFunction listener = elementEvents.get(i);
if (listener.hasEventType(etype)
&& (originalEventType == null || originalEventType
assertEquals("red", $("button").css("color", false));
assertEquals("black", $("button").css("background-color", false));
}
+
+ public void testIssue152() {
+ $(e).html("<div class='mdiv'>");
+ final GQuery div = $(".mdiv", e);
+ final int[] count = { 0 };
+ div.one(Event.ONCLICK, null, new Function() {
+ public void f() {
+ count[0]++;
+ div.one(Event.ONCLICK, null, new Function() {
+ public void f() {
+ fail();
+ }
+ });
+ };
+ });
+ div.click();
+ assertEquals(1, count[0]);
+ }
}