Bug Tracker

Ticket #5037: isSynthesized.patch

File isSynthesized.patch, 841 bytes (added by happygiraffe, 11 years ago)

Add isSynthesized member to event object. Patched against 1.3.2

  • test/unit/event.js

     
    264264        }).load();
    265265});
    266266
     267test("trigger() event.isSynthesized", function() {
     268        expect(1);
     269        jQuery('#check1').click(function(event) {
     270            ok( event.isSynthesized, "Check that click() knows it's a synthesized event" );
     271        }).click();
     272});
     273
    267274test("trigger() bubbling", function() {
    268275        expect(14);
    269276
  • src/event.js

     
    207207                }
    208208
    209209                event.currentTarget = elem;
     210                event.isSynthesized = true;
    210211
    211212                // Trigger the event, it is assumed that "handle" is a function
    212213                var handle = jQuery.data(elem, "handle");