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
df0996e3
authored
2012-07-07 13:22:15 +0200
by
Nicklas Ansman Giertz
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Don't compile the bindingRegExp more times than needed
1 parent
9a6db123
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
src/rivets.coffee
src/rivets.coffee
View file @
df0996e
...
...
@@ -51,11 +51,12 @@ class Rivets.View
# Builds the Rivets.Binding instances for the view.
build
:
=>
@
bindings
=
[]
bindingRegExp
=
@
bindingRegExp
()
for
node
in
@
el
.
getElementsByTagName
'*'
for
attribute
in
node
.
attributes
if
@
bindingRegExp
()
.
test
attribute
.
name
type
=
attribute
.
name
.
replace
@
bindingRegExp
()
,
''
if
bindingRegExp
.
test
attribute
.
name
type
=
attribute
.
name
.
replace
bindingRegExp
,
''
pipes
=
attribute
.
value
.
split
(
'|'
).
map
(
pipe
)
->
pipe
.
trim
()
path
=
pipes
.
shift
().
split
'.'
model
=
@
models
[
path
.
shift
()]
...
...
Please
register
or
sign in
to post a comment