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
babbf49a
authored
2012-11-17 00:11:53 -0800
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Clean up formattedValue implementation.
1 parent
924b7ba1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
11 deletions
src/rivets.coffee
src/rivets.coffee
View file @
babbf49
...
...
@@ -37,17 +37,17 @@ class Rivets.Binding
for
formatter
in
@
formatters
args
=
formatter
.
split
/\s+/
id
=
args
.
shift
()
value
=
if
@
model
[
id
]
instanceof
Function
@
model
[
id
]
value
,
args
...
else
if
Rivets
.
formatters
[
id
]
if
Rivets
.
formatters
[
id
].
read
instanceof
Function
Rivets
.
formatters
[
id
].
read
value
,
args
...
else
if
Rivets
.
formatters
[
id
]
instanceof
Function
# could occur if fmt = { publish: function() {}}
Rivets
.
formatters
[
id
]
value
,
args
...
else
# skip if no read function exists
value
else
# skip if no formatter exists
value
formatter
=
if
@
model
[
id
]
instanceof
Function
@
model
[
id
]
else
Rivets
.
formatters
[
id
]
if
formatter
?
.
read
instanceof
Function
value
=
formatter
.
read
value
,
args
...
else
if
formatter
instanceof
Function
value
=
formatter
value
,
args
...
value
# Sets the value for the binding. This Basically just runs the binding routine
...
...
Please
register
or
sign in
to post a comment