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
047720c5
authored
2012-09-03 13:46:37 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Implement a select function instead of preset selects like bidirectionals.
1 parent
5b4492b5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
src/rivets.coffee
src/rivets.coffee
View file @
047720c
...
...
@@ -178,8 +178,9 @@ class Rivets.View
parseNode
node
for
node
in
el
.
getElementsByTagName
'*'
return
bidirectionals
:
=>
binding
for
binding
in
@
bindings
when
binding
.
isBidirectional
()
# Returns an array of bindings where the supplied function evaluates to true.
select
:
(
fn
)
=>
binding
for
binding
in
@
bindings
when
fn
binding
# Binds all of the current bindings for this view.
bind
:
=>
...
...
@@ -193,7 +194,7 @@ class Rivets.View
binding
.
sync
()
for
binding
in
@
bindings
publish
:
=>
binding
.
publish
()
for
binding
in
@
bidirectionals
()
binding
.
publish
()
for
binding
in
@
select
(
b
)
->
b
.
isBidirectional
()
# Cross-browser event binding
bindEvent
=
(
el
,
event
,
fn
)
->
...
...
Please
register
or
sign in
to post a comment