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
6cb9af1e
authored
2013-06-22 02:29:54 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Add the textNode internal binder for fast lookups when building out textNode bindings. [#181]
1 parent
266a3308
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletions
src/rivets.coffee
src/rivets.coffee
View file @
6cb9af1
...
...
@@ -24,7 +24,7 @@ class Rivets.Binding
# containing view, the DOM node, the type of binding, the model object and the
# keypath at which to listen for changes.
constructor
:
(
@
view
,
@
el
,
@
type
,
@
key
,
@
keypath
,
@
options
=
{})
->
unless
@
binder
=
@
view
.
binders
[
type
]
unless
@
binder
=
Rivets
.
internalBinders
[
@
type
]
or
@
view
.
binders
[
type
]
for
identifier
,
value
of
@
view
.
binders
if
identifier
isnt
'*'
and
identifier
.
indexOf
(
'*'
)
isnt
-
1
regexp
=
new
RegExp
"^
#{
identifier
.
replace
(
'*'
,
'.+'
)
}
$"
...
...
@@ -537,6 +537,15 @@ Rivets.binders =
else
el
.
removeAttribute
@
type
# Rivets.internalBinders
# ----------------------
# Contextually sensitive binders that are used outside of the standard attribute
# bindings. Put here for fast lookups and to prevent them from being overridden.
Rivets
.
internalBinders
=
textNode
:
(
node
,
value
)
->
node
.
data
=
value
?
''
# Rivets.config
# -------------
...
...
Please
register
or
sign in
to post a comment