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
8ba303c7
authored
2012-07-31 21:53:56 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Make sure all dependency observers get unbinded when calling Rivets.Binding::unbind().
1 parent
e7a734d3
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
src/rivets.coffee
src/rivets.coffee
View file @
8ba303c
...
...
@@ -64,13 +64,15 @@ class Rivets.Binding
@
set
Rivets
.
config
.
adapter
.
read
@
model
,
@
keypath
if
@
options
.
dependencies
?
.
length
for
keypath
in
@
options
.
dependencies
Rivets
.
config
.
adapter
.
subscribe
@
model
,
keypath
,
(
stub
)
=>
@
reset
=
(
value
)
=>
@
set
if
@
options
.
bypass
@
model
[
@
keypath
]
else
Rivets
.
config
.
adapter
.
read
@
model
,
@
keypath
for
keypath
in
@
options
.
dependencies
Rivets
.
config
.
adapter
.
subscribe
@
model
,
keypath
,
@
reset
if
@
type
in
@
bidirectionals
bindEvent
@
el
,
'change'
,
@
publish
...
...
@@ -83,6 +85,10 @@ class Rivets.Binding
unbind
:
=>
Rivets
.
config
.
adapter
.
unsubscribe
@
model
,
@
keypath
,
@
set
if
@
options
.
dependencies
?
.
length
for
keypath
in
@
options
.
dependencies
Rivets
.
config
.
adapter
.
unsubscribe
@
model
,
keypath
,
@
reset
if
@
type
in
@
bidirectionals
@
el
.
removeEventListener
'change'
,
@
publish
...
...
Please
register
or
sign in
to post a comment