Skip to content

Commit a76952f

Browse files
author
Onischenko, Yaroslav(yonischenko)
committed
Merge pull request #216 from magento-nord/develop
[NORD] Bugs
2 parents dce931b + 28709d5 commit a76952f

File tree

1 file changed

+10
-15
lines changed
  • app/code/Magento/Ui/view/base/web/js/form/components

1 file changed

+10
-15
lines changed

app/code/Magento/Ui/view/base/web/js/form/components/tab_group.js

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -57,34 +57,29 @@ define([
5757
* @param {Object} elem
5858
*/
5959
validate: function (elem) {
60-
var source = this.source,
61-
result = elem.delegate('validate'),
62-
invalid = false;
60+
var result = elem.delegate('validate'),
61+
invalid;
6362

64-
_.some(result, function (item) {
65-
return !item.valid && (invalid = item.target);
63+
invalid = _.find(result, function (item) {
64+
return !item.valid;
6665
});
6766

68-
if (invalid && !source.get('params.invalid')) {
69-
source.set('params.invalid', true);
70-
67+
if (invalid) {
7168
elem.activate();
72-
invalid.focused(true);
69+
invalid.target.focused(true);
7370
}
71+
72+
return invalid;
7473
},
7574

7675
/**
7776
* Sets 'allValid' property of instance to true, then calls 'validate' method
7877
* of instance for each element.
7978
*/
8079
onValidate: function () {
81-
var elems;
82-
83-
elems = this.elems.sortBy(function (elem) {
80+
this.elems.sortBy(function (elem) {
8481
return !elem.active();
85-
});
86-
87-
elems.forEach(this.validate, this);
82+
}).some(this.validate, this);
8883
}
8984
});
9085
});

0 commit comments

Comments
 (0)