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
aea72d47
authored
2012-07-05 15:53:46 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Use the @bindingRegExp function directly from inside @build.
1 parent
da922b4e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
8 deletions
lib/rivets.js
src/rivets.coffee
lib/rivets.js
View file @
aea72d4
...
...
@@ -83,9 +83,8 @@
};
View
.
prototype
.
build
=
function
()
{
var
attribute
,
bindingRegExp
,
context
,
keypath
,
node
,
path
,
pipes
,
type
,
_i
,
_len
,
_ref
,
_results
;
var
attribute
,
context
,
keypath
,
node
,
path
,
pipes
,
type
,
_i
,
_len
,
_ref
,
_results
;
this
.
bindings
=
[];
bindingRegExp
=
this
.
bindingRegExp
();
_ref
=
this
.
el
.
getElementsByTagName
(
'*'
);
_results
=
[];
for
(
_i
=
0
,
_len
=
_ref
.
length
;
_i
<
_len
;
_i
++
)
{
...
...
@@ -96,8 +95,8 @@
_results1
=
[];
for
(
_j
=
0
,
_len1
=
_ref1
.
length
;
_j
<
_len1
;
_j
++
)
{
attribute
=
_ref1
[
_j
];
if
(
bindingRegExp
.
test
(
attribute
.
name
))
{
type
=
attribute
.
name
.
replace
(
bindingRegExp
,
''
);
if
(
this
.
bindingRegExp
()
.
test
(
attribute
.
name
))
{
type
=
attribute
.
name
.
replace
(
this
.
bindingRegExp
()
,
''
);
pipes
=
attribute
.
value
.
split
(
'|'
).
map
(
function
(
pipe
)
{
return
pipe
.
trim
();
});
...
...
src/rivets.coffee
View file @
aea72d4
...
...
@@ -51,12 +51,10 @@ class Rivets.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
'.'
context
=
@
contexts
[
path
.
shift
()]
...
...
Please
register
or
sign in
to post a comment