Skip to content

Commit

Permalink
make sessions selectable to toggle session checkboes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcusgreen committed Oct 28, 2023
1 parent 25db2d7 commit 2241262
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions amd/src/modform.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,36 @@ export const init = () => {
e.addEventListener('click', cmidClick);
});
configureSelectAll();
configureSessions();

/**
*
* @param {*} e
*/
function cmidClick(e) {
debugger;
console.log('hello');
var id = e.currentTarget.id.split('_')[2];
var checkboxid = 'id_activitygroup_activity_' +id;
var checkbox = document.getElementById(checkboxid);
checkbox.checked = !checkbox.checked;
configureSelectAll();
}


function configureSessions(){
var sessions = document.querySelectorAll('input[id*="_ses_"]');
sessions.forEach(function(e) {
e.addEventListener('click', sessionClick());
});
}
function sessionClick(e){
debugger;
console.log('hello');
var sessionid = e.currentTarget.id.split('_')[3];
// debugger;
// console.log(sessionid);
}
/**
* Set up the selectAll checkbox
*/
Expand Down

0 comments on commit 2241262

Please sign in to comment.