Skip to content
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

__bindEvents #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

__bindEvents #4

wants to merge 2 commits into from

Conversation

jamiemlaw
Copy link

No description provided.

Now, when defining a new Ply view, the user can define an `__events` objects on the prototype, that takes as its keys an event name and the object id, separated by a space, e.g. `'click closeBtn'` would be used to attach a click handler to `this.objects.closeBtn`. As its values, it takes the name of the function to execute, e.g. `'close'` to run `this.close`. The callback function takes two arguments: the first is the event object, and the second is a shortcut to the element that triggered the event. Within the function, `this` refers to the Ply object, not the element, like in previous versions of Ply. This removes the need to use `self`, and allows for referencing other methods.
@ghost ghost assigned richardscarrott Dec 16, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants