Project

General

Profile

Bug #7504

Info blocks do not work inside a table

Added by Jim Pingle 8 months ago. Updated 4 months ago.

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

100%

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.

Associated revisions

Revision 666be0be
Added by Jim Pingle 8 months ago

Per sbeaver, disable an IE workaround, which fixes #7504

History

#1 Updated by Jim Pingle 8 months ago

  • Status changed from Assigned to Feedback
  • % Done changed from 0 to 100

#2 Updated by James Snell 8 months 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!

#3 Updated by Jim Pingle 8 months ago

  • Status changed from Feedback to Resolved

Thanks for testing!

#4 Updated by NOYB NOYB 4 months 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>');
+    }
+});

Also available in: Atom PDF