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
5a5b030e
authored
2014-03-20 17:13:15 -0500
by
Ean Schuessler
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Only listen for changes on model in routine()
1 parent
eef0b67c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
rivets-error-binder.js
rivets-error-binder.js
View file @
5a5b030
...
...
@@ -53,9 +53,9 @@ define(['rivets', 'bootstrap'], function(rivets) {
$
(
holder
.
container
).
removeClass
(
'focused'
);
},
blur
:
function
()
{
holder
.
lastObj
.
seen
(
holder
.
lastId
,
true
);
if
(
holder
.
lastObj
)
holder
.
lastObj
.
seen
(
holder
.
lastId
,
true
);
$
(
holder
.
container
).
addClass
(
'focused'
);
holder
.
lastObj
.
validate
();
if
(
holder
.
lastObj
)
holder
.
lastObj
.
validate
();
},
validated
:
function
(
isValid
,
model
,
errors
)
{
var
errorList
=
errors
[
holder
.
lastId
];
...
...
@@ -69,11 +69,6 @@ define(['rivets', 'bootstrap'], function(rivets) {
}
}
};
diveIntoObject
(
this
.
observer
.
target
,
this
.
observer
.
key
.
path
,
function
(
obj
,
id
)
{
holder
.
lastObj
=
obj
;
holder
.
lastId
=
id
;
obj
.
on
(
'validated'
,
holder
.
validated
);
});
$
(
el
).
on
(
'focus'
,
holder
.
focus
).
on
(
'blur'
,
holder
.
blur
);
rivetsBinderCall
(
this
,
this
.
args
[
0
],
'bind'
,
arguments
);
},
...
...
@@ -88,6 +83,15 @@ define(['rivets', 'bootstrap'], function(rivets) {
rivetsBinderCall
(
this
,
this
.
args
[
0
],
'unbind'
,
arguments
);
},
routine
:
function
(
el
,
value
)
{
var
holder
=
this
.
validationHolder
;
if
(
holder
.
lastObj
)
{
holder
.
lastObj
.
off
(
'validated'
,
holder
.
validated
);
}
diveIntoObject
(
this
.
observer
.
target
,
this
.
observer
.
key
.
path
,
function
(
obj
,
id
)
{
holder
.
lastObj
=
obj
;
holder
.
lastId
=
id
;
obj
.
on
(
'validated'
,
holder
.
validated
);
});
rivetsBinderCall
(
this
,
this
.
args
[
0
],
'routine'
,
arguments
);
}
};
...
...
Please
register
or
sign in
to post a comment