forked from sakaiproject/sakai
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SAK-46087 GBNG > import > item selection > no way to select all (saka…
- Loading branch information
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/************************************************************************************** | ||
* Gradebook Import Javascript | ||
*************************************************************************************/ | ||
var GBI = GBI || {}; | ||
|
||
GBI.selectAllNone = function( element ) | ||
{ | ||
const selectAll = $(element).prop( "checked" ); | ||
|
||
// Toggling the gradebook item checkbox will also toggle it's corresponding comment checkbox if it has one, but not vice versa; see below comment | ||
$(".import_selection_item").each( function() { GBI.toggleCheckBox( selectAll, this ); }); | ||
|
||
// This is needed in the case where comment is selected but associated gradebook item is not | ||
$(".import_selection_comment").each( function() { GBI.toggleCheckBox( selectAll, this ); }); | ||
}; | ||
|
||
GBI.toggleCheckBox = function( selectAll, element ) | ||
{ | ||
const checkbox = $(element); | ||
if( (selectAll && !checkbox.prop( "checked" )) || (!selectAll && checkbox.prop( "checked" )) ) | ||
{ | ||
// Fire click handler so we don't have to duplicate the handler's logic here | ||
checkbox.click(); | ||
} | ||
}; |