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
20f4b3c6
authored
2013-09-29 14:35:44 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Don't force the use of data attributes. Make the prefix an absolute prefix instead.
1 parent
92b2cb08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
src/binders.coffee
src/rivets.coffee
src/view.coffee
src/binders.coffee
View file @
20f4b3c
...
...
@@ -67,7 +67,7 @@ Rivets.binders.if =
bind
:
(
el
)
->
unless
@
marker
?
attr
=
[
'data'
,
@
view
.
config
.
prefix
,
@
type
].
join
(
'-'
).
replace
'--'
,
'-'
attr
=
[
@
view
.
config
.
prefix
,
@
type
].
join
(
'-'
).
replace
'--'
,
'-'
declaration
=
el
.
getAttribute
attr
@
marker
=
document
.
createComment
" rivets:
#{
@
type
}
#{
declaration
}
"
...
...
@@ -131,7 +131,7 @@ Rivets.binders['each-*'] =
bind
:
(
el
)
->
unless
@
marker
?
attr
=
[
'data'
,
@
view
.
config
.
prefix
,
@
type
].
join
(
'-'
).
replace
'--'
,
'-'
attr
=
[
@
view
.
config
.
prefix
,
@
type
].
join
(
'-'
).
replace
'--'
,
'-'
@
marker
=
document
.
createComment
" rivets:
#{
@
type
}
"
@
iterated
=
[]
...
...
src/rivets.coffee
View file @
20f4b3c
...
...
@@ -19,7 +19,9 @@ Rivets =
# The default configuration, publicly accessible on `module.config`. Can be
# overridden globally or local to a `Rivets.View` instance.
config
:
pre
loadData
:
true
pre
fix
:
'rv'
rootInterface
:
'.'
preloadData
:
true
handler
:
(
context
,
ev
,
binding
)
->
@
call
context
,
ev
,
binding
.
view
.
models
...
...
src/view.coffee
View file @
20f4b3c
...
...
@@ -18,12 +18,11 @@ class Rivets.View
# Regular expression used to match binding attributes.
bindingRegExp
:
=>
prefix
=
@
config
.
prefix
if
prefix
then
new
RegExp
(
"^data-
#{
prefix
}
-"
)
else
/^data-/
new
RegExp
"^
#{
@
config
.
prefix
}
-"
# Regular expression used to match component nodes.
componentRegExp
:
=>
new
RegExp
"^
#{
@
config
.
prefix
?
.
toUpperCase
()
?
'RV'
}
-"
new
RegExp
"^
#{
@
config
.
prefix
.
toUpperCase
()
}
-"
# Parses the DOM tree and builds `Rivets.Binding` instances for every matched
# binding declaration.
...
...
Please
register
or
sign in
to post a comment