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
bd766b4f
authored
2013-10-18 01:06:37 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix textNode binding issue (was using appendChild instead of inserting in place). [#210]
1 parent
d29df654
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
10 deletions
src/view.coffee
src/view.coffee
View file @
bd766b4
...
...
@@ -54,20 +54,13 @@ class Rivets.View
if
delimiters
=
@
config
.
templateDelimiters
if
(
tokens
=
parser
.
parse
(
node
.
data
,
delimiters
)).
length
unless
tokens
.
length
is
1
and
tokens
[
0
].
type
is
parser
.
types
.
text
[
startToken
,
restTokens
...]
=
tokens
node
.
data
=
startToken
.
value
if
startToken
.
type
is
0
node
.
data
=
startToken
.
value
else
buildBinding
'TextBinding'
,
node
,
null
,
startToken
.
value
for
token
in
restTokens
for
token
in
tokens
text
=
document
.
createTextNode
token
.
value
node
.
parentNode
.
appendChild
text
node
.
parentNode
.
insertBefore
text
,
node
if
token
.
type
is
1
buildBinding
'TextBinding'
,
text
,
null
,
token
.
value
node
.
parentNode
.
removeChild
node
else
if
componentRegExp
.
test
node
.
tagName
type
=
node
.
tagName
.
replace
(
componentRegExp
,
''
).
toLowerCase
()
@
bindings
.
push
new
Rivets
.
ComponentBinding
@
,
node
,
type
...
...
Please
register
or
sign in
to post a comment