Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
f05701d3
authored
2013-05-13 23:59:14 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Call the event handler with the same context, but pass in the view as a second a…
…rgument. [Closes #161]
1 parent
421bf22b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
src/rivets.coffee
src/rivets.coffee
View file @
f05701d
...
...
@@ -251,8 +251,8 @@ class Rivets.View
# Houses common utility functions used internally by Rivets.js.
Rivets
.
Util
=
# Create a single DOM event binding.
bindEvent
:
(
el
,
event
,
handler
,
context
)
->
fn
=
(
e
)
->
handler
.
call
context
,
e
bindEvent
:
(
el
,
event
,
handler
,
view
)
->
fn
=
(
e
v
)
->
handler
.
call
@
,
ev
,
view
if
window
.
jQuery
?
el
=
jQuery
el
...
...
@@ -364,7 +364,7 @@ Rivets.binders =
function
:
true
routine
:
(
el
,
value
)
->
Rivets
.
Util
.
unbindEvent
el
,
@
args
[
0
],
@
currentListener
if
@
currentListener
@
currentListener
=
Rivets
.
Util
.
bindEvent
el
,
@
args
[
0
],
value
,
@
model
@
currentListener
=
Rivets
.
Util
.
bindEvent
el
,
@
args
[
0
],
value
,
@
view
"each-*"
:
block
:
true
...
...
Please
register
or
sign in
to post a comment