Skip to content
Permalink
Browse files

We no longer support globally-triggered events on plain objects. This…

… is a trade-off to having good garbage collection on the objects.
  • Loading branch information
jeresig committed Mar 2, 2010
1 parent 86ace44 commit 5c111a028a2c86f2392d987951db3a980900f1bd
Showing with 4 additions and 13 deletions.
  1. +4 −13 test/unit/event.js
@@ -1715,24 +1715,15 @@ test("delegate with submit", function() {
});

test("Non DOM element events", function() {
expect(3);

jQuery({})
.bind('nonelementglobal', function(e) {
ok( true, "Global event on non-DOM annonymos object triggered" );
});
expect(1);

var o = {};

jQuery(o)
.bind('nonelementobj', function(e) {
ok( true, "Event on non-DOM object triggered" );
}).bind('nonelementglobal', function() {
ok( true, "Global event on non-DOM object triggered" );
});
jQuery(o).bind('nonelementobj', function(e) {
ok( true, "Event on non-DOM object triggered" );
});

jQuery(o).trigger('nonelementobj');
jQuery.event.trigger('nonelementglobal');
});

/*

0 comments on commit 5c111a0

Please sign in to comment.
You can’t perform that action at this time.