Skip to content

Commit

Permalink
Style updates for child rows
Browse files Browse the repository at this point in the history
  • Loading branch information
aanunez committed Dec 21, 2021
1 parent 4a9a5f8 commit 3aa268d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 11 deletions.
9 changes: 7 additions & 2 deletions site.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,22 @@

#mainDataTable {
width: 100%!important;
border: grey 1px solid;
border-radius: 5px;
}

.dataTablesRow {

}

.dataTablesRow .container, .dataTableChild .container {
padding-left: 1%;
font-family: "Verlag";
}

.dataTableChild .slider{
display: none;
}

.dataTablesDisplayCol{

}
Expand All @@ -33,7 +38,7 @@
}

.dataTables_filter input{
margin-bottom: 0;
margin-bottom: 0.5em;
}

.page-link {
Expand Down
23 changes: 14 additions & 9 deletions site.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
});

Expand Down Expand Up @@ -114,7 +115,11 @@ let ctri = {
},

generateHTMLforChild: () => {
return `<div class="container">Placeholder</div>`;
return `<div class="container slider">
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.
</div>`;
},

generateExpandButton: () => {
Expand Down

0 comments on commit 3aa268d

Please sign in to comment.