Skip to content

Commit

Permalink
Merge pull request #216 from magento-nord/develop
Browse files Browse the repository at this point in the history
[NORD] Bugs
  • Loading branch information
Onischenko, Yaroslav(yonischenko) committed Nov 30, 2015
2 parents dce931b + 28709d5 commit a76952f
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,34 +57,29 @@ define([
* @param {Object} elem
*/
validate: function (elem) {
var source = this.source,
result = elem.delegate('validate'),
invalid = false;
var result = elem.delegate('validate'),
invalid;

_.some(result, function (item) {
return !item.valid && (invalid = item.target);
invalid = _.find(result, function (item) {
return !item.valid;
});

if (invalid && !source.get('params.invalid')) {
source.set('params.invalid', true);

if (invalid) {
elem.activate();
invalid.focused(true);
invalid.target.focused(true);
}

return invalid;
},

/**
* Sets 'allValid' property of instance to true, then calls 'validate' method
* of instance for each element.
*/
onValidate: function () {
var elems;

elems = this.elems.sortBy(function (elem) {
this.elems.sortBy(function (elem) {
return !elem.active();
});

elems.forEach(this.validate, this);
}).some(this.validate, this);
}
});
});

0 comments on commit a76952f

Please sign in to comment.