diff --git a/opentech/static_src/src/javascript/main.js b/opentech/static_src/src/javascript/main.js index bda8806fd13b75754043bb6c6852c2b6759628f4..e06d6fb33253d77cce8727139071b78f60b119a8 100755 --- a/opentech/static_src/src/javascript/main.js +++ b/opentech/static_src/src/javascript/main.js @@ -74,6 +74,18 @@ import '@fancyapps/fancybox'; // Add <tr> toggle arrow $('.tr--parent td.title').prepend('<span class="js-tr-toggle arrow"></span>'); + + // Toggle show/hide for submissions overview table rows + const children = Array.prototype.slice.call( + document.querySelectorAll('.js-tr-toggle') + ); + + children.forEach(function (child) { + child.addEventListener('click', function (e) { + $(e.target).closest('.tr--parent').toggleClass('is-expanded'); + }); + }); + }); // Add active class to filters - dropdowns are dynamically appended to the dom,