Skip to content

Commit

Permalink
enable universal use of modal and tab_group, allow having child eleme…
Browse files Browse the repository at this point in the history
…nts which do not need to be validated
  • Loading branch information
netzkollektiv committed Sep 6, 2017
1 parent 6f25236 commit 4687f71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ define([
invalid;

invalid = _.find(result, function (item) {
return !item.valid;
return typeof item !== 'undefined' && !item.valid;
});

if (invalid) {
Expand Down
3 changes: 3 additions & 0 deletions app/code/Magento/Ui/view/base/web/js/modal/modal-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ define([
* Validate everything validatable in modal
*/
validate: function (elem) {
if (typeof elem === 'undefined') {
return;
}
if (typeof elem.validate === 'function') {
this.valid = this.valid & elem.validate().valid;
} else if (elem.elems) {
Expand Down

0 comments on commit 4687f71

Please sign in to comment.