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
d7965f97
authored
2012-08-06 16:38:53 -0700
by
Michael Richards
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'master' into move-formatters-outside-config
2 parents
efa6fe0e
5938aeaa
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
src/rivets.coffee
src/rivets.coffee
View file @
d7965f9
...
...
@@ -122,11 +122,12 @@ class Rivets.View
type
=
attribute
.
name
.
replace
bindingRegExp
,
''
pipes
=
(
pipe
.
trim
()
for
pipe
in
attribute
.
value
.
split
'|'
)
context
=
(
ctx
.
trim
()
for
ctx
in
pipes
.
shift
().
split
'>'
)
path
=
context
.
shift
().
split
/(\.|:)/
path
=
context
.
shift
()
splitPath
=
path
.
split
/\.|:/
options
.
formatters
=
pipes
model
=
@
models
[
p
ath
.
shift
()]
options
.
bypass
=
path
.
shift
()
is
':'
keypath
=
p
ath
.
join
()
model
=
@
models
[
splitP
ath
.
shift
()]
options
.
bypass
=
path
.
indexOf
(
":"
)
!=
-
1
keypath
=
splitP
ath
.
join
()
if
dependencies
=
context
.
shift
()
options
.
dependencies
=
dependencies
.
split
/\s+/
...
...
@@ -153,17 +154,19 @@ class Rivets.View
bindEvent
=
(
el
,
event
,
fn
)
->
# Check to see if addEventListener is available.
if
window
.
addEventListener
el
.
addEventListener
event
,
fn
el
.
addEventListener
event
,
fn
,
false
else
# Assume we are in IE and use attachEvent.
event
=
"on"
+
event
el
.
attachEvent
event
,
fn
unbindEvent
=
(
el
,
event
,
fn
)
->
# Check to see if addEventListener is available.
if
window
.
removeEventListener
el
.
removeEventListener
event
,
fn
el
.
removeEventListener
event
,
fn
,
false
else
# Assume we are in IE and use attachEvent.
event
=
"on"
+
event
el
.
detachEvent
event
,
fn
# Returns the current input value for the specified element.
...
...
Please
register
or
sign in
to post a comment