Skip to content

Commit

Permalink
SAK-42077 : Can't show a gradebook item when clicking arrows (sakaipr…
Browse files Browse the repository at this point in the history
  • Loading branch information
frasese authored and bjones86 committed Jul 23, 2019
1 parent 2b0f9a3 commit 533aaf2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions gradebookng/tool/src/webapp/scripts/gradebook-gbgrade-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1255,10 +1255,16 @@ GbGradeTable.modelIndexForStudent = function(studentId) {
};


GbGradeTable.colForAssignment = function(assignmentId) {
return GbGradeTable.findIndex(GbGradeTable.instance.view.settings.columns, function(column) {
return column._data_ && column._data_.assignmentId === parseInt(assignmentId);
});
GbGradeTable.colForAssignment = function(assignmentId, array) {
if (array === undefined){
return GbGradeTable.findIndex(GbGradeTable.instance.view.settings.columns, function(column) {
return column._data_ && column._data_.assignmentId === parseInt(assignmentId, 10);
});
} else {
return GbGradeTable.findIndex(array, function(column) {
return column.assignmentId && column.assignmentId === parseInt(assignmentId, 10);
});
}
};

GbGradeTable.colForCategoryScore = function(categoryId) {
Expand Down Expand Up @@ -1987,7 +1993,7 @@ GbGradeTable.setupToggleGradeItems = function() {
var data = $.data($th[0]);
var index = 0;
if (data.columnType == "assignment") {
index = GbGradeTable.colForAssignment(data.assignmentid) - GbGradeTable.instance.getSettings().fixedColumnsLeft + 1;
index = GbGradeTable.colForAssignment(data.assignmentid, GbGradeTable.columns) + 1;
} else if (data.columnType == "category") {
index = GbGradeTable.colForCategoryScore(data.categoryId) - GbGradeTable.instance.getSettings().fixedColumnsLeft + 1;
}
Expand Down

0 comments on commit 533aaf2

Please sign in to comment.