Newer
Older
(function ($) {
'use strict';
Chris Lawton
committed
// add the toggle arrow before the submission titles
$('.all-submissions-table__parent td.title').prepend('<span class="all-submissions-table__toggle js-toggle-submission"><span class="arrow"></span></span>');
Chris Lawton
committed
// grab all the toggles
const children = Array.prototype.slice.call(
Chris Lawton
committed
document.querySelectorAll('.js-toggle-submission')
Chris Lawton
committed
// show/hide the submission child rows
children.forEach(function (child) {
child.addEventListener('click', (e) => {
$(e.target).closest('.all-submissions-table__parent').toggleClass('is-expanded');