Bug #7504
closed
Info blocks do not work inside a table
Added by Jim Pingle over 7 years ago.
Updated about 7 years ago.
Affected Architecture:
All
Description
While attempting to make some collapsible info blocks in the certificates list, I found that the click event to show/hide info blocks doesn't work in that context.
Steve B is investigating, so far it looks like it isn't working inside a table.
- Status changed from Assigned to Feedback
- % Done changed from 0 to 100
Tested 2.4.0.b.20170502.2240 from:
- Microsoft Edge 38.14393.1066.0
- Internet Explorer 11.1066.14393.0
Info block in the certificates list is expanding and collapsing as expected.
Test passed, thanks!
- Status changed from Feedback to Resolved
Fix with conditional instead of removing. - /usr/local/www/js/pfSenseHelpers.js
-// Put a dummy row into any empty table to keep IE happy
-// Commented out due to https://redmine.pfsense.org/issues/7504
-//$('tbody').each(function(){
-// $(this).html($.trim($(this).html()))
-//});
+// IE overflows table when tbody is empty/whitespace.
+// Put a dummy row into any empty/whitespace tbody to prevent empty table scroll bars.
+$('tbody').each(function(){
+ if ($(this).html().trim().length == 0) {
+ var colCount = 0;
+
+ // Get the number of table columns.
+ $(this).parent().find('tr:first').children().each(function() {
+ if ($(this).attr('colspan')) {
+ colCount += +$(this).attr('colspan');
+ } else {
+ colCount++;
+ }
+ });
-$('tbody:empty').html("<tr><td></td></tr>");
+ // Insert the dummy row, spanning all the table columns.
+ $(this).html('<tr><td colspan='+colCount+'></td></tr>');
+ }
+});
Also available in: Atom
PDF