Skip to content

Commit 57470b9

Browse files
authored
Merge pull request #388 from ImagingDataCommons/idc-test-sp
Hotfix #384, Sprint 15
2 parents 2df4f85 + a875925 commit 57470b9

File tree

13 files changed

+204
-144
lines changed

13 files changed

+204
-144
lines changed

static/css/search.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,8 +343,8 @@ tr {
343343
#series_table td.series-description {
344344
width:32%;
345345
}
346-
#series_table_head th.text_data,
347-
#series_table td.text_data {
346+
#series_table_head th.open-viewer,
347+
#series_table td.open-viewer {
348348
width:13%;
349349
}
350350

static/css/style.css

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

static/js/base.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,6 @@ require([
141141
type: 'numeric'
142142
});
143143

144-
$('#cohort-table').tablesorter({
145-
headers: {
146-
0: {sorter:false}
147-
},
148-
sortList: [[1]]
149-
});
150-
151144
$(document).ready(function(){
152145
if(sessionStorage.getItem("reloadMsg")) {
153146
var msg = JSON.parse(sessionStorage.getItem("reloadMsg"));

static/js/cohorts/cohort-list.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,57 @@ require.config({
2222
jquery: 'libs/jquery-3.5.1',
2323
bootstrap: 'libs/bootstrap.min',
2424
jqueryui: 'libs/jquery-ui.min',
25+
'datatables.net': 'libs/jquery.dataTables.min',
2526
underscore: 'libs/underscore-min',
2627
tablesorter:'libs/jquery.tablesorter.min',
2728
base: 'base'
2829
},
2930
shim: {
3031
'bootstrap': ['jquery'],
3132
'jqueryui': ['jquery'],
33+
'datatables.net': ['jquery'],
3234
'tablesorter': ['jquery'],
3335
'base': ['jquery'],
3436
}
3537
});
3638

3739
require([
3840
'jquery',
41+
'datatables.net',
3942
'base',
4043
'jqueryui',
4144
'bootstrap',
4245
'tablesorter'
4346
], function($,base) {
47+
var cohort_list_table = $('#cohort-table').DataTable({
48+
"dom": '<"dataTables_controls"ilpf>rt<"bottom"><"clear">',
49+
"order": [[ 2, "desc" ]],
50+
"columns": [
51+
{ "orderable": false },
52+
{ "orderable": false },
53+
null,
54+
null,
55+
null,
56+
null
57+
]
58+
});
59+
60+
$('#cohort-table tbody').on('click', 'td.details-control', function () {
61+
var tr = $(this).parents('tr');
62+
var row = cohort_list_table.row(tr);
63+
64+
if (row.child.isShown()) {
65+
// This row is already open - close it
66+
row.child.hide();
67+
tr.removeClass('shown');
68+
$(this).prop('title', 'Click to display cohort description.');
69+
} else {
70+
$(this).prop('title', 'Click to hide cohort description.');
71+
var desc = tr.attr('data-description');
72+
(row.child() && row.child().length) ? row.child.show() : row.child($(`<tr><td></td><td colspan="5"><p>`+desc+`</p></td></tr>`)).show();
73+
tr.addClass('shown');
74+
}
75+
});
4476

4577
// Resets forms in modals on cancel. Suppressed warning when leaving page with dirty forms
4678
$('.modal').on('hide.bs.modal', function() {

static/js/collections_list.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,8 @@ require(['jquery', 'datatables.net','jqueryui', 'bootstrap', 'base'],
3838
tr.addClass('shown');
3939
}
4040
});
41+
42+
$(window).on('load', function(){
43+
$('.collex-panel').removeClass('hidden');
44+
});
4145
});

static/js/explore.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,4 +207,23 @@ require([
207207
maxWidth: 300
208208
});
209209

210+
tippy.delegate('.series-table', {
211+
content: function(reference) {
212+
return $(reference).data('study-id');
213+
},
214+
theme: 'dark',
215+
placement: 'right',
216+
arrow: false,
217+
target: '.study-id-col',
218+
maxWidth: 300
219+
});
220+
221+
tippy.delegate('.series-table', {
222+
content: 'Please open at the study level to see this series',
223+
theme: 'dark',
224+
placement: 'right',
225+
arrow: false,
226+
target: '.no-viewer-tooltip',
227+
maxWidth: 130
228+
});
210229
});

0 commit comments

Comments
 (0)