20bc656b by Adam Heath

Fetch the observer.key.path and store it in a local variable.

1 parent 645f3f28
......@@ -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.path] = true;
holder.seen[keyPath] = true;
render(el, 'blur', false);
if (observer.target) {
observer.target.validate();
}
},
validated: function(isValid, model, errors) {
var errorList = errors[observer.key.path];
if (errorList && holder.seen[holder.observer.key.path]) {
var errorList = errors[keyPath];
if (errorList && holder.seen[keyPath]) {
render(el, 'validated', errorList);
} else {
render(el, 'validated', false);
......