Skip to content

Commit c52e77e

Browse files
committed
-> shim: remove datatables applied table widths for now
1 parent a50260f commit c52e77e

1 file changed

Lines changed: 5 additions & 17 deletions

File tree

static/js/tables.js

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
8282
});
8383
$('#proj_table, #cases_tab, #studies_tab, #series_tab, #cart-table').on('draw.dt', function(){
8484
window.hide_spinner();
85+
// Auto-width needing to be shut off at the table header level during draw time.
86+
$(this).children('th').each(function() {
87+
this.style.width = null;
88+
});
8589
});
8690

8791
// Update the rows in the Projects Table, clear the other tables.
@@ -456,7 +460,6 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
456460
});
457461
}
458462

459-
460463
window.getProjectCartStats = function(projidArr){
461464
var parsedFiltObj = filterutils.parseFilterObj();
462465
parsedFiltObj.collection_id = projidArr;
@@ -756,15 +759,10 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
756759
updatePromise.reject();
757760
}
758761

759-
// Remove element-level styles so CSS widths can prevail, preserving our tooltip behavior
762+
// Remove autowidthing from the table header, which is reapplied any time it's created
760763
$('#cases_table_head').children('tr').children().each(function(){
761764
this.style.width=null;
762765
});
763-
$('#cases_tab').on('draw.dt', function(){
764-
$('#cases_table_head').children('tr').children().each(function(){
765-
this.style.width=null;
766-
});
767-
});
768766

769767
$('#cases_tab').find('tbody').attr('id','cases_table');
770768

@@ -1137,11 +1135,6 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
11371135
$('#studies_table_head').children('tr').children().each(function(){
11381136
this.style.width=null;
11391137
});
1140-
$('#studies_tab').on('draw.dt', function(){
1141-
$('#studies_table_head').children('tr').children().each(function(){
1142-
this.style.width=null;
1143-
});
1144-
})
11451138

11461139
$('#studies_tab').children('tbody').attr('id','studies_table');
11471140
$('#studies_tab_wrapper').find('.dataTables_controls').find('.dataTables_length').after(
@@ -1506,11 +1499,6 @@ define(['cartutils','filterutils','tippy','jquery', 'base'], function(cartutils,
15061499
$('#series_table_head').children('tr').children().each(function(){
15071500
this.style.width=null;
15081501
});
1509-
$('#series_tab').on('draw.dt', function(){
1510-
$('#series_table_head').children('tr').children().each(function(){
1511-
this.style.width=null;
1512-
});
1513-
});
15141502
$('#series_tab').children('tbody').attr('id','series_table');
15151503
$('#series_tab_wrapper').find('.dataTables_controls').find('.dataTables_length').after(
15161504
'<div class="dataTables_goto_page"><label>Page </label><input class="goto-page-number" type="number">'

0 commit comments

Comments
 (0)