Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
AUI-1378 - Source formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonathan Mak committed Jun 18, 2014
1 parent 2f91f5f commit b399e85
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/aui-form-validator/js/aui-form-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -960,11 +960,13 @@ var FormValidator = A.Component.create({
var instance = this,
ancestor,
field,
label,
nextSibling,
stackContainer,
target,
validator;

label = instance.get(LABEL_CSS_CLASS);
validator = event.validator;
field = validator.field;

Expand All @@ -980,8 +982,15 @@ var FormValidator = A.Component.create({
if (nextSibling && nextSibling.get('nodeType') === 3) {
ancestor = field.ancestor();

if (ancestor && ancestor.hasClass(instance.get(LABEL_CSS_CLASS)) || ancestor.hasClass('radio'))) {
target = nextSibling;
if (ancestor) {
if (ancestor.hasClass(label)) {
target = nextSibling;
}
else if (A.FormValidator.isCheckable(target)) {
var label = ancestor.previous('.' + label);

target = label;
}
}
}

Expand Down

0 comments on commit b399e85

Please sign in to comment.