|
990 | 990 | minValidRange = $.mage.parseNumber(validRange[1]);
|
991 | 991 | maxValidRange = $.mage.parseNumber(validRange[2]);
|
992 | 992 | result = result &&
|
993 |
| - (isNaN(minValidRange) || minValue >= minValidRange) && |
994 |
| - (isNaN(maxValidRange) || maxValue <= maxValidRange); |
| 993 | + (isNaN(minValidRange) || minValue >= minValidRange) && |
| 994 | + (isNaN(maxValidRange) || maxValue <= maxValidRange); |
995 | 995 | }
|
996 | 996 | }
|
997 | 997 |
|
|
1109 | 1109 | options = p.find('input');
|
1110 | 1110 |
|
1111 | 1111 | return options.map(function (el) {
|
1112 |
| - return $(el).val(); |
1113 |
| - }).length > 0; |
| 1112 | + return $(el).val(); |
| 1113 | + }).length > 0; |
1114 | 1114 | },
|
1115 | 1115 | $.mage.__('Please select one of the options above.')
|
1116 | 1116 | ],
|
|
1922 | 1922 | * @param {jQuery.Event} event
|
1923 | 1923 | * @param {Object} validation
|
1924 | 1924 | */
|
1925 |
| - listenFormValidateHandler: function (event, validation) { |
| 1925 | + listenFormValidateHandler: function (event, validation) { |
1926 | 1926 | var firstActive = $(validation.errorList[0].element || []),
|
1927 | 1927 | lastActive = $(validation.findLastActive() ||
|
1928 | 1928 | validation.errorList.length && validation.errorList[0].element || []),
|
1929 |
| - parent, windowHeight, successList; |
| 1929 | + windowHeight = $(window).height(), |
| 1930 | + parent, successList; |
1930 | 1931 |
|
1931 | 1932 | if (lastActive.is(':hidden')) {
|
1932 | 1933 | parent = lastActive.parent();
|
1933 |
| - windowHeight = $(window).height(); |
1934 | 1934 | $('html, body').animate({
|
1935 | 1935 | scrollTop: parent.offset().top - windowHeight / 2
|
1936 | 1936 | });
|
|
1948 | 1948 | }
|
1949 | 1949 |
|
1950 | 1950 | if (firstActive.length) {
|
1951 |
| - $('html, body').stop().animate({ |
1952 |
| - scrollTop: firstActive.offset().top |
| 1951 | + $('body').stop().animate({ |
| 1952 | + scrollTop: firstActive.offset().top - windowHeight / 2 |
1953 | 1953 | });
|
1954 | 1954 | firstActive.focus();
|
1955 | 1955 | }
|
|
0 commit comments