Skip to content

Commit

Permalink
SAK-46156 Improve gradebook JS rendering time in some browsers (sakai…
Browse files Browse the repository at this point in the history
  • Loading branch information
plukasew authored Sep 1, 2021
1 parent cbdcc3f commit cb57482
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,10 @@ GbGradeTable.renderTable = function (elementId, tableData) {
GbGradeTable.COURSE_GRADE_COLUMN_INDEX = GbGradeTable.FIXED_COLUMN_OFFSET - 1; // course grade is always the last fixed column
GbGradeTable.domElement.addClass('gb-fixed-columns-' + GbGradeTable.FIXED_COLUMN_OFFSET);

if (sakai && sakai.locale && sakai.locale.userLanguage) {
GbGradeTable.numFmt = new Intl.NumberFormat(sakai.locale.userLanguage);
}

GbGradeTable.grades = GbGradeTable.mergeColumns(GbGradeTable.unpack(tableData.serializedGrades,
tableData.rowCount,
tableData.columnCount),
Expand Down Expand Up @@ -3121,8 +3125,8 @@ GbGradeTable.localizeNumber = function(number) {
return;
}

if (sakai && sakai.locale && sakai.locale.userLanguage) {
return parseFloat(number).toLocaleString(sakai.locale.userLanguage);
if (GbGradeTable.numFmt) {
return GbGradeTable.numFmt.format(parseFloat(number));
}

return '' + number;
Expand Down

0 comments on commit cb57482

Please sign in to comment.