Bug Tracker

Opened 5 years ago

Closed 5 years ago

#9209 closed bug (worksforme)

.one is broken

Reported by: c.bakker@… 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.

Change History (1)

comment:1 Changed 5 years ago by rwaldron

  • Component changed from unfiled to event
  • Priority changed from undecided to low
  • Resolution set to worksforme
  • Status changed from new to closed

Works as expected in latest

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

Note: See TracTickets for help on using tickets.