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
3ce0f6a2
authored
2013-07-13 18:35:59 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Update the buildBinding function to take the type of binding as the first argument.
1 parent
47931082
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
src/rivets.coffee
src/rivets.coffee
View file @
3ce0f6a
...
...
@@ -263,7 +263,7 @@ class Rivets.View
componentRegExp
=
@
componentRegExp
()
buildBinding
=
(
node
,
type
,
declaration
)
=>
buildBinding
=
(
binding
,
node
,
type
,
declaration
)
=>
options
=
{}
pipes
=
(
pipe
.
trim
()
for
pipe
in
declaration
.
split
'|'
)
...
...
@@ -284,7 +284,7 @@ class Rivets.View
if
dependencies
=
context
.
shift
()
options
.
dependencies
=
dependencies
.
split
/\s+/
@
bindings
.
push
new
Rivets
.
Binding
@
,
node
,
type
,
key
,
keypath
,
options
@
bindings
.
push
new
Rivets
[
binding
]
@
,
node
,
type
,
key
,
keypath
,
options
parse
=
(
node
)
=>
unless
node
in
skipNodes
...
...
@@ -299,11 +299,11 @@ class Rivets.View
switch
startToken
.
type
when
0
then
node
.
data
=
startToken
.
value
when
1
then
buildBinding
node
,
'textNode'
,
startToken
.
value
when
1
then
buildBinding
'TextBinding'
,
node
,
null
,
startToken
.
value
for
token
in
restTokens
node
.
parentNode
.
appendChild
(
text
=
document
.
createTextNode
token
.
value
)
buildBinding
text
,
'textNode'
,
token
.
value
if
token
.
type
is
1
buildBinding
'TextBinding'
,
text
,
null
,
token
.
value
if
token
.
type
is
1
else
if
componentRegExp
.
test
node
.
tagName
type
=
node
.
tagName
.
replace
(
componentRegExp
,
''
).
toLowerCase
()
@
bindings
.
push
new
Rivets
.
ComponentBinding
@
,
node
,
type
...
...
@@ -328,7 +328,7 @@ class Rivets.View
for
attribute
in
attributes
or
node
.
attributes
if
bindingRegExp
.
test
attribute
.
name
type
=
attribute
.
name
.
replace
bindingRegExp
,
''
buildBinding
node
,
type
,
attribute
.
value
buildBinding
'Binding'
,
node
,
type
,
attribute
.
value
parse
childNode
for
childNode
in
node
.
childNodes
...
...
Please
register
or
sign in
to post a comment