Project

General

Profile

Actions

Bug #7504

closed

Info blocks do not work inside a table

Added by Jim Pingle almost 7 years ago. Updated over 6 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Web Interface
Target version:
Start date:
05/02/2017
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.4
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.

Actions #1

Updated by Jim Pingle almost 7 years ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100
Actions #2

Updated by James Snell almost 7 years ago

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!

Actions #3

Updated by Jim Pingle almost 7 years ago

  • Status changed from Feedback to Resolved

Thanks for testing!

Actions #4

Updated by NOYB NOYB over 6 years ago

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>');
+    }
+});
Actions

Also available in: Atom PDF