MCPcopy Create free account
hub / github.com/angular-ui/ui-grid / maxChange

Function maxChange

lib/test/angular/1.8.0/angular.js:27137–27157  ·  view source on GitHub ↗
(val)

Source from the content-addressed store, hash-verified

27135 }
27136
27137 function maxChange(val) {
27138 maxVal = parseNumberAttrVal(val);
27139 // ignore changes before model is initialized
27140 if (isNumberNaN(ctrl.$modelValue)) {
27141 return;
27142 }
27143
27144 if (supportsRange) {
27145 var elVal = element.val();
27146 // IE11 doesn't set the el val correctly if the maxVal is less than the element value
27147 if (maxVal < elVal) {
27148 element.val(maxVal);
27149 // IE11 and Chrome don't set the value to the minVal when max < min
27150 elVal = maxVal < minVal ? minVal : maxVal;
27151 }
27152 ctrl.$setViewValue(elVal);
27153 } else {
27154 // TODO(matsko): implement validateLater to reduce number of validations
27155 ctrl.$validate();
27156 }
27157 }
27158
27159 function stepChange(val) {
27160 stepVal = parseNumberAttrVal(val);

Callers

nothing calls this directly

Calls 1

parseNumberAttrValFunction · 0.70

Tested by

no test coverage detected