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
bbc1d12f
authored
2012-08-10 01:47:17 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Skip all nodes in an iteration context unless building the views for the iterated items.
1 parent
b0cb46e2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
src/rivets.coffee
src/rivets.coffee
View file @
bbc1d12
...
...
@@ -114,13 +114,27 @@ class Rivets.View
# Builds the Rivets.Binding instances for the view.
build
:
=>
@
bindings
=
[]
skipNodes
=
[]
iterator
=
null
bindingRegExp
=
@
bindingRegExp
()
eventRegExp
=
/^on-/
iterationRegExp
=
/^each-/
parseNode
=
(
node
)
=>
unless
node
in
skipNodes
for
attribute
in
node
.
attributes
if
bindingRegExp
.
test
attribute
.
name
type
=
attribute
.
name
.
replace
bindingRegExp
,
''
if
iterationRegExp
.
test
type
unless
@
models
[
type
.
replace
iterationRegExp
,
''
]
skipNodes
.
push
n
for
n
in
node
.
getElementsByTagName
'*'
iterator
=
[
attribute
]
for
attribute
in
iterator
or
node
.
attributes
iterator
=
null
if
bindingRegExp
.
test
attribute
.
name
options
=
{}
type
=
attribute
.
name
.
replace
bindingRegExp
,
''
...
...
Please
register
or
sign in
to post a comment