Fetch the observer.key.path and store it in a local variable.
Showing
1 changed file
with
4 additions
and
3 deletions
... | @@ -35,6 +35,7 @@ define(function(require) { | ... | @@ -35,6 +35,7 @@ define(function(require) { |
35 | rivets.binders['error-*'] = { | 35 | rivets.binders['error-*'] = { |
36 | bind: function(el) { | 36 | bind: function(el) { |
37 | var observer = this.observer; | 37 | var observer = this.observer; |
38 | var keyPath = observer.key.path; | ||
38 | var holder = this.validationHolder = { | 39 | var holder = this.validationHolder = { |
39 | //marker: el.parentNode.insertBefore(document.createComment(" rivets: " + this.type + " "), el), | 40 | //marker: el.parentNode.insertBefore(document.createComment(" rivets: " + this.type + " "), el), |
40 | observer: observer, | 41 | observer: observer, |
... | @@ -43,15 +44,15 @@ define(function(require) { | ... | @@ -43,15 +44,15 @@ define(function(require) { |
43 | render(el, 'focus', false); | 44 | render(el, 'focus', false); |
44 | }, | 45 | }, |
45 | blur: function() { | 46 | blur: function() { |
46 | holder.seen[observer.key.path] = true; | 47 | holder.seen[keyPath] = true; |
47 | render(el, 'blur', false); | 48 | render(el, 'blur', false); |
48 | if (observer.target) { | 49 | if (observer.target) { |
49 | observer.target.validate(); | 50 | observer.target.validate(); |
50 | } | 51 | } |
51 | }, | 52 | }, |
52 | validated: function(isValid, model, errors) { | 53 | validated: function(isValid, model, errors) { |
53 | var errorList = errors[observer.key.path]; | 54 | var errorList = errors[keyPath]; |
54 | if (errorList && holder.seen[holder.observer.key.path]) { | 55 | if (errorList && holder.seen[keyPath]) { |
55 | render(el, 'validated', errorList); | 56 | render(el, 'validated', errorList); |
56 | } else { | 57 | } else { |
57 | render(el, 'validated', false); | 58 | render(el, 'validated', false); | ... | ... |
-
Please register or sign in to post a comment