Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Widget: Added ._bind() for easily binding events with correct context…
… and disabled checking. Pretty much a direct copy from the previous bind branch.
- Loading branch information
1 parent
67b070f
commit 659db70
Showing
2 changed files
with
115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
659db70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point we should remove those old bind branches...
Whats the deal with this new branch?
659db70
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was having trouble getting bind2 to a reasonable state, so I started a new branch. I deleted the old bind branches as soon as I created this one. I wanted to play around with some other ideas. For example,
this._bind({ click: "clickHandler" })
to bind tothis.clickHandler
but wait until the click to figure out what function we're executing. This allows us to bind to a function while still allowing the function to be proxied later, which is an important feature that "just works" when you have to manually store a reference tothis
and wrap your handler in an anonymous function.I also want to test out implementing
._hoverable( elem )
and._focusable( elem )
on top of._bind()
to remove a lot of the duplicated code across our widgets.