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
5d649eee
authored
2013-09-29 17:40:20 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
s/setModel/setObserver. Store reference to the observer on the Rivets.Binding instance.
1 parent
1becef4e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
src/bindings.coffee
src/bindings.coffee
View file @
5d649ee
...
...
@@ -10,7 +10,7 @@ class Rivets.Binding
@
formatters
=
@
options
.
formatters
||
[]
@
dependencies
=
[]
@
setBinder
()
@
set
Model
()
@
set
Observer
()
setBinder
:
=>
unless
@
binder
=
@
view
.
binders
[
@
type
]
...
...
@@ -25,16 +25,16 @@ class Rivets.Binding
@
binder
or=
@
view
.
binders
[
'*'
]
@
binder
=
{
routine
:
@
binder
}
if
@
binder
instanceof
Function
set
Model
:
=>
observer
=
new
KeypathObserver
@
view
,
@
view
.
models
,
@
keypath
,
(
target
)
=>
set
Observer
:
=>
@
observer
=
new
KeypathObserver
@
view
,
@
view
.
models
,
@
keypath
,
(
target
)
=>
@
unbind
true
if
@
key
@
model
=
target
@
bind
true
if
@
key
@
sync
()
@
rootKey
=
observer
.
root
@
key
=
observer
.
key
@
model
=
observer
.
target
@
rootKey
=
@
observer
.
root
@
key
=
@
observer
.
key
@
model
=
@
observer
.
target
# Applies all the current formatters to the supplied value and returns the
# formatted value.
...
...
@@ -190,7 +190,7 @@ class Rivets.TextBinding extends Rivets.Binding
constructor
:
(
@
view
,
@
el
,
@
type
,
@
keypath
,
@
options
=
{})
->
@
formatters
=
@
options
.
formatters
||
[]
@
dependencies
=
[]
@
set
Model
()
@
set
Observer
()
# A standard routine binder used for text node bindings.
binder
:
...
...
Please
register
or
sign in
to post a comment