|
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 |
|
|
1115 | 1115 | options = p.find('input');
|
1116 | 1116 |
|
1117 | 1117 | return options.map(function (el) {
|
1118 |
| - return $(el).val(); |
1119 |
| - }).length > 0; |
| 1118 | + return $(el).val(); |
| 1119 | + }).length > 0; |
1120 | 1120 | },
|
1121 | 1121 | $.mage.__('Please select one of the options above.')
|
1122 | 1122 | ],
|
|
1932 | 1932 | * @param {jQuery.Event} event
|
1933 | 1933 | * @param {Object} validation
|
1934 | 1934 | */
|
1935 |
| - listenFormValidateHandler: function (event, validation) { |
| 1935 | + listenFormValidateHandler: function (event, validation) { |
1936 | 1936 | var firstActive = $(validation.errorList[0].element || []),
|
1937 | 1937 | lastActive = $(validation.findLastActive() ||
|
1938 | 1938 | validation.errorList.length && validation.errorList[0].element || []),
|
1939 |
| - parent, windowHeight, successList; |
| 1939 | + windowHeight = $(window).height(), |
| 1940 | + parent, successList; |
1940 | 1941 |
|
1941 | 1942 | if (lastActive.is(':hidden')) {
|
1942 | 1943 | parent = lastActive.parent();
|
1943 |
| - windowHeight = $(window).height(); |
1944 | 1944 | $('html, body').animate({
|
1945 | 1945 | scrollTop: parent.offset().top - windowHeight / 2
|
1946 | 1946 | });
|
|
1958 | 1958 | }
|
1959 | 1959 |
|
1960 | 1960 | if (firstActive.length) {
|
1961 |
| - $('html, body').stop().animate({ |
1962 |
| - scrollTop: firstActive.offset().top |
| 1961 | + $('body').stop().animate({ |
| 1962 | + scrollTop: firstActive.offset().top - windowHeight / 2 |
1963 | 1963 | });
|
1964 | 1964 | firstActive.focus();
|
1965 | 1965 | }
|
|
0 commit comments