From 3aa268d3615a0c50275506811fe7a3eb0dcd21b5 Mon Sep 17 00:00:00 2001 From: adam nunez Date: Tue, 21 Dec 2021 11:35:33 -0600 Subject: [PATCH] Style updates for child rows --- site.css | 9 +++++++-- site.js | 23 ++++++++++++++--------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/site.css b/site.css index b292cff..413c1d5 100644 --- a/site.css +++ b/site.css @@ -4,6 +4,8 @@ #mainDataTable { width: 100%!important; + border: grey 1px solid; + border-radius: 5px; } .dataTablesRow { @@ -11,10 +13,13 @@ } .dataTablesRow .container, .dataTableChild .container { - padding-left: 1%; font-family: "Verlag"; } +.dataTableChild .slider{ + display: none; +} + .dataTablesDisplayCol{ } @@ -33,7 +38,7 @@ } .dataTables_filter input{ - margin-bottom: 0; + margin-bottom: 0.5em; } .page-link { diff --git a/site.js b/site.js index d12affb..77e89fd 100644 --- a/site.js +++ b/site.js @@ -50,18 +50,19 @@ let ctri = { $("input.form-control").prop('placeholder','Search journal entries'); $(".dataTablesRow").append(ctri.generateExpandButton()); - $('.expandButton').on('click', (e) => { - let $rowEl = $(e.currentTarget).parent(); + $('#mainDataTable tbody').on('click', '.expandButton', (e) => { + let $tr = $(e.currentTarget).parent(); let table = $('#mainDataTable').DataTable(); - let row = table.row($rowEl); + let row = table.row($tr); if (row.child.isShown()) { - row.child.hide(); - $rowEl.removeClass('shown'); + $('div.slider', row.child()).slideUp( () => { + row.child.hide(); + $tr.removeClass('shown'); + }); } else { - let cells = table.cells(row, '.expandedInfo').render('display'); row.child( ctri.generateHTMLforChild(), 'dataTableChild').show(); - $rowEl.next().addClass($rowEl.hasClass('even') ? 'even' : 'odd'); - $rowEl.addClass('shown'); + $tr.addClass('shown'); + $('div.slider', row.child()).slideDown(); } }); @@ -114,7 +115,11 @@ let ctri = { }, generateHTMLforChild: () => { - return `
Placeholder
`; + return `
+ Cofresí RU, Hajcak G, Piasecki TM, Bartholow BD. Internal Consistency and Test-Retest Reliability of the P3 Event-Related Potential (ERP) Elicited by Alcoholic and Non-Alcoholic Beverage Pictures. Psychophysiology. Online November 15, 2021. + Cofresí RU, Hajcak G, Piasecki TM, Bartholow BD. Internal Consistency and Test-Retest Reliability of the P3 Event-Related Potential (ERP) Elicited by Alcoholic and Non-Alcoholic Beverage Pictures. Psychophysiology. Online November 15, 2021. + Cofresí RU, Hajcak G, Piasecki TM, Bartholow BD. Internal Consistency and Test-Retest Reliability of the P3 Event-Related Potential (ERP) Elicited by Alcoholic and Non-Alcoholic Beverage Pictures. Psychophysiology. Online November 15, 2021. +
`; }, generateExpandButton: () => {