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
078497e0
authored
2012-09-03 14:07:42 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Remove event dependency from Rivets.Binding::publish.
1 parent
edb23973
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
src/rivets.coffee
src/rivets.coffee
View file @
078497e
...
...
@@ -65,6 +65,10 @@ class Rivets.Binding
else
Rivets
.
config
.
adapter
.
read
@
model
,
@
keypath
# Publishes the value currently set on the input element back to the model.
publish
:
=>
Rivets
.
config
.
adapter
.
publish
@
model
,
@
keypath
,
getInputValue
@
el
# Subscribes to the model for changes at the specified keypath. Bi-directional
# routines will also listen for changes on the element to propagate them back
# to the model.
...
...
@@ -82,11 +86,6 @@ class Rivets.Binding
if
@
isBidirectional
()
bindEvent
@
el
,
'change'
,
@
publish
# Publishes the value currently set on the input element back to the model.
publish
:
(
e
)
=>
el
=
e
.
target
or
e
.
srcElement
Rivets
.
config
.
adapter
.
publish
@
model
,
@
keypath
,
getInputValue
el
# Unsubscribes from the model and the element.
unbind
:
=>
unless
@
options
.
bypass
...
...
Please
register
or
sign in
to post a comment