feat: update min grade cutoff from 997 to 99 (#29475)

This commit is contained in:
Ben Warzeski
2021-12-01 10:29:29 -05:00
committed by GitHub
parent d1904bd99b
commit 2f4fedc237

View File

@@ -214,10 +214,13 @@ define(['js/views/validation',
var widthPerPoint = cachethis.gradeBarWidth / 100;
return function(event, ui) {
var barIndex = ui.element.index();
// min and max represent limits not labels (note, can's make smaller than 3 points wide)
var min = (barIndex < cachethis.descendingCutoffs.length ? cachethis.descendingCutoffs[barIndex].cutoff + 3 : 3);
var offset = 1;
// min and max represent limits not labels
var min = (barIndex < cachethis.descendingCutoffs.length
? cachethis.descendingCutoffs[barIndex].cutoff + offset
: offset);
// minus 2 b/c minus 1 is the element we're effecting. It's max is just shy of the next one above it
var max = (barIndex >= 2 ? cachethis.descendingCutoffs[barIndex - 2].cutoff - 3 : 97);
var max = (barIndex >= 2 ? cachethis.descendingCutoffs[barIndex - 2].cutoff - offset : 99);
ui.element.resizable('option', {minWidth: min * widthPerPoint, maxWidth: max * widthPerPoint});
};
},
@@ -227,10 +230,13 @@ define(['js/views/validation',
var cachethis = this;
return function(event, ui) {
var barIndex = ui.element.index();
var offset = 1;
// min and max represent limits not labels (note, can's make smaller than 3 points wide)
var min = (barIndex < cachethis.descendingCutoffs.length ? cachethis.descendingCutoffs[barIndex].cutoff + 3 : 3);
var min = (barIndex < cachethis.descendingCutoffs.length
? cachethis.descendingCutoffs[barIndex].cutoff + offset
: offset);
// minus 2 b/c minus 1 is the element we're effecting. It's max is just shy of the next one above it
var max = (barIndex >= 2 ? cachethis.descendingCutoffs[barIndex - 2].cutoff - 3 : 100);
var max = (barIndex >= 2 ? cachethis.descendingCutoffs[barIndex - 2].cutoff - offset : 100);
var percentage = Math.min(Math.max(ui.size.width / cachethis.gradeBarWidth * 100, min), max);
cachethis.descendingCutoffs[barIndex - 1].cutoff = Math.round(percentage);
cachethis.renderGradeRanges();