Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
rivets-error-binder
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
20bc656b
authored
2016-09-01 11:25:35 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fetch the observer.key.path and store it in a local variable.
1 parent
645f3f28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
src/scripts/rivets-error-binder.js
src/scripts/rivets-error-binder.js
View file @
20bc656
...
...
@@ -35,6 +35,7 @@ define(function(require) {
rivets
.
binders
[
'error-*'
]
=
{
bind
:
function
(
el
)
{
var
observer
=
this
.
observer
;
var
keyPath
=
observer
.
key
.
path
;
var
holder
=
this
.
validationHolder
=
{
//marker: el.parentNode.insertBefore(document.createComment(" rivets: " + this.type + " "), el),
observer
:
observer
,
...
...
@@ -43,15 +44,15 @@ define(function(require) {
render
(
el
,
'focus'
,
false
);
},
blur
:
function
()
{
holder
.
seen
[
observer
.
key
.
p
ath
]
=
true
;
holder
.
seen
[
keyP
ath
]
=
true
;
render
(
el
,
'blur'
,
false
);
if
(
observer
.
target
)
{
observer
.
target
.
validate
();
}
},
validated
:
function
(
isValid
,
model
,
errors
)
{
var
errorList
=
errors
[
observer
.
key
.
p
ath
];
if
(
errorList
&&
holder
.
seen
[
holder
.
observer
.
key
.
p
ath
])
{
var
errorList
=
errors
[
keyP
ath
];
if
(
errorList
&&
holder
.
seen
[
keyP
ath
])
{
render
(
el
,
'validated'
,
errorList
);
}
else
{
render
(
el
,
'validated'
,
false
);
...
...
Please
register
or
sign in
to post a comment