Skip to main content

Bug Tracker

Side navigation

#9209 closed bug (worksforme)

Opened May 10, 2011 08:56AM UTC

Closed May 10, 2011 02:42PM UTC

.one is broken

Reported by: c.bakker@gmx.net Owned by:
Priority: low Milestone: 1.next
Component: event Version: 1.6
Keywords: Cc:
Blocked by: Blocking:
Description

It seems like the .one function is broken. It executes multiple times. I've put some example code on JSFiddle: http://jsfiddle.net/KeesCBakker/8KY9d/5/.

Html:

<button>Create</button>

<div>

</div>

jQuery document load:

$('button').click(function(){

$('div').append('<span>Header1</span>');

$('div').append('<span>Header2</span>');

$('div').trigger('load');

});

$('div').one('load', function(){

$('span').addClass('header');

});

Result:

It keeps adding red header elements, but it should only do so the first time.

Remarks:

When I use 1.5.2 everything works fine.

Attachments (0)
Change History (1)

Changed May 10, 2011 02:42PM UTC by rwaldron comment:1

component: unfiledevent
priority: undecidedlow
resolution: → worksforme
status: newclosed

Works as expected in latest

http://jsfiddle.net/rwaldron/8KY9d/10/