New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can/event #870

Merged
merged 44 commits into from Apr 11, 2014

Conversation

Projects
None yet
2 participants
@andykant
Contributor

andykant commented Apr 4, 2014

This adds support for the can/event mixin. This replaces can/util/event.js (although that module has been updated to maintain support for the old API). The mixin provides common event methods: addEvent/removeEvent/on/off/dispatch/trigger/etc.

can/event implements high performance event support for normal objects and prototypes, but unlike before, can now be easily mixed into objects and prototypes: can.extend(SomeClass.prototype, can.event)

Along with the basic can/event mixin, there are also some plugins included:

  • can/event/propagate: Official Plugin Adds event propagation for normal objects.
  • can/event/delegate: Beta Plugin Adds event delegation; this is not an official plugin yet as it could use some API refinement. Currently it only supports delegation for objects created and named with can.Construct-derived classes.
  • can/event/namespace: Beta Plugin Adds event namespacing; this is not an official plugin yet as it conflicts with can.Map events. Currently can.Maps are excluded from namespacing, but it might be better to drop this plugin entirely and encourage users to use can.event.listenTo and can.event.stopListening to manage event handlers owned by another object.

I verified that these work with all of the libraries as well as old IE.

This pull request completes #768 and #769, and also includes the changes made in #760.

andykant and others added some commits Feb 28, 2014

Adding .bind()/.unbind() fallback calls to .delegate/.undelegate in l…
…ibrary support files (#754)

Conflicts:
	util/dojo/dojo.js
	util/mootools/mootools.js
	util/yui/yui.js
Fixed delegate/undelegate in Dojo and Zepto
Added fallbacks but also reverted to can.bind/unbind when no delegate
selector was specified.

Conflicts:
	util/dojo/dojo.js
Merge branch 'minor' into can-event (and merge can/util/event.js chan…
…ges to can/event)

Conflicts:
	test/dojo.html
	test/jquery-2.html
	test/jquery.html
	test/yui.html
	test/zepto.html
	util/attr/attr_test.js
	util/event.js
Updated the docco/documentation for can/event
Also made a minor API tweak for the propagate plugin

@andykant andykant added this to the 2.1.0 milestone Apr 4, 2014

daffl added a commit that referenced this pull request Apr 11, 2014

@daffl daffl merged commit c43426c into minor Apr 11, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@daffl daffl deleted the can-event branch Apr 11, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment