File tree Expand file tree Collapse file tree 1 file changed +10
-15
lines changed
app/code/Magento/Ui/view/base/web/js/form/components Expand file tree Collapse file tree 1 file changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -57,34 +57,29 @@ define([
57
57
* @param {Object } elem
58
58
*/
59
59
validate : function ( elem ) {
60
- var source = this . source ,
61
- result = elem . delegate ( 'validate' ) ,
62
- invalid = false ;
60
+ var result = elem . delegate ( 'validate' ) ,
61
+ invalid ;
63
62
64
- _ . some ( result , function ( item ) {
65
- return ! item . valid && ( invalid = item . target ) ;
63
+ invalid = _ . find ( result , function ( item ) {
64
+ return ! item . valid ;
66
65
} ) ;
67
66
68
- if ( invalid && ! source . get ( 'params.invalid' ) ) {
69
- source . set ( 'params.invalid' , true ) ;
70
-
67
+ if ( invalid ) {
71
68
elem . activate ( ) ;
72
- invalid . focused ( true ) ;
69
+ invalid . target . focused ( true ) ;
73
70
}
71
+
72
+ return invalid ;
74
73
} ,
75
74
76
75
/**
77
76
* Sets 'allValid' property of instance to true, then calls 'validate' method
78
77
* of instance for each element.
79
78
*/
80
79
onValidate : function ( ) {
81
- var elems ;
82
-
83
- elems = this . elems . sortBy ( function ( elem ) {
80
+ this . elems . sortBy ( function ( elem ) {
84
81
return ! elem . active ( ) ;
85
- } ) ;
86
-
87
- elems . forEach ( this . validate , this ) ;
82
+ } ) . some ( this . validate , this ) ;
88
83
}
89
84
} ) ;
90
85
} ) ;
You can’t perform that action at this time.
0 commit comments