Skip to main content

Bug Tracker

Side navigation

#7458 closed bug (invalid)

Opened November 10, 2010 04:26PM UTC

Closed November 10, 2010 07:19PM UTC

Last modified November 10, 2010 11:22PM UTC

slow click event handle?

Reported by: ult_raa@mail.ru Owned by: ult_raa@mail.ru
Priority: undecided Milestone:
Component: unfiled Version: 1.4.3
Keywords: Cc:
Blocked by: Blocking:
Description

i have modal div with table on it. Clicks on tr removes them (it cant resize automaticly by css, so i have $.modalUpdate() function to resize modal window), and $.modalRemove() binded to modal outside clicks.

$(document).bind('click.modalOutsideClick', function(e){
	if($(e.target).closest('.modal').attr('class') != 'modal')
		$.modalRemove();
});

$('tr').live('click',function(){
	$('tr').remove();
	$.modalUpdate();
}

so, when tr.click event fires, $.modalRemove() fires too.

only if tr.remove runs after delay - it will work normal.

$('tr').live('click',function(){
	setTimeout(function() {
		$('tr').remove();
		$.modalUpdate();
	}, 100);
}
Attachments (0)
Change History (7)

Changed November 10, 2010 04:51PM UTC by SlexAxton comment:1

owner: → ult_raa@mail.ru
status: newpending

Can you reduce this and post a test case at jsFiddle.com? That would greatly help us narrow down the issue for you.

Thanks.

Changed November 10, 2010 05:46PM UTC by ult_raa@mail.ru comment:2

status: pendingnew

Replying to [comment:1 SlexAxton]:

Can you reduce this and post a test case at jsFiddle.com? That would greatly help us narrow down the issue for you. Thanks.

http://jsfiddle.net/BtWBA/5/

Changed November 10, 2010 07:19PM UTC by rwaldron comment:3

milestone: 1.5
resolution: → invalid
status: newclosed

Commenting out "$('.opaque, .modal').remove();" in $.modalRemove() function corrects this issue.

http://jsfiddle.net/rwaldron/BtWBA/7/

The forums are a better place to ask about these things, you'll get faster and more detailed replies there. Be Excellent to youself!

Changed November 10, 2010 08:46PM UTC by anonymous comment:4

You do not quite understand me correctly. Function $.modalRemove() is triggered when it should not do that. Event click.modalOutsideClick must run a function $.modalRemove() when the event target is not .modal child. Please read the example carefully.

Click on .modal child must remove this child and do nothing. But it also fires $.modalRemove().

Changed November 10, 2010 09:10PM UTC by rwaldron comment:5

Actually, I understand this very well. It's still not a jQuery bug. You have issues with your event binding and delegation.

Take a look around here: "click.modalOutsideClick".

Changed November 10, 2010 11:14PM UTC by anonymous comment:6

I'm very sorry

only now found out about event bubbling

sorry for any inconvenience

Changed November 10, 2010 11:22PM UTC by rwaldron comment:7

It's no problem! Glad we could facilitate a learning experience :D