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
edc9c231
authored
2013-05-24 15:35:39 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update the model setters to use @view.models is the @key is null (top-level keypath). [Closes #172]
1 parent
3f439a7a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/rivets.coffee
src/rivets.coffee
View file @
edc9c23
...
...
@@ -36,7 +36,7 @@ class Rivets.Binding
@
binder
or=
@
view
.
binders
[
'*'
]
@
binder
=
{
routine
:
@
binder
}
if
@
binder
instanceof
Function
@
formatters
=
@
options
.
formatters
||
[]
@
model
=
@
view
.
models
[
@
key
]
@
model
=
if
@
key
then
@
view
.
models
[
@
key
]
else
@
view
.
models
# Applies all the current formatters to the supplied value and returns the
# formatted value.
...
...
@@ -139,7 +139,7 @@ class Rivets.Binding
# the old model first and then re-binds with the new model.
update
:
=>
@
unbind
()
@
model
=
@
view
.
models
[
@
key
]
@
model
=
if
@
key
then
@
view
.
models
[
@
key
]
else
@
view
.
models
@
bind
()
# Rivets.View
...
...
Please
register
or
sign in
to post a comment