diff mbox

[Branch,~linaro-validation/lava-dashboard/trunk] Rev 331: ensure table row heights match up in image status view

Message ID 20120824002610.28097.61663.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Michael-Doyle Hudson Aug. 24, 2012, 12:26 a.m. UTC
------------------------------------------------------------
revno: 331
committer: Michael Hudson-Doyle <michael.hudson@linaro.org>
branch nick: image-status-row-height
timestamp: Fri 2012-08-24 12:24:42 +1200
message:
  ensure table row heights match up in image status view
modified:
  dashboard_app/static/js/image-report.js


--
lp:lava-dashboard
https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk

You are subscribed to branch lp:lava-dashboard.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dashboard/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'dashboard_app/static/js/image-report.js'
--- dashboard_app/static/js/image-report.js	2012-07-16 22:51:19 +0000
+++ dashboard_app/static/js/image-report.js	2012-08-24 00:24:42 +0000
@@ -9,6 +9,19 @@ 
     scroller.width(scroller.width() + space);
     if (atRight) scroller.scrollLeft(table.attr('scrollWidth'));
 }
+function _fixRowHeights () {
+    var index = 0;
+    var nameRows = $("#test-run-names > tbody > tr");
+    var resultRows = $("#results-table > tbody > tr");
+    for (; index < nameRows.length; index++) {
+        var nameRow = $(nameRows[index]);
+        var resultRow = $(resultRows[index]);
+        var nameRowHeight = parseInt(nameRow.css('height'));
+        var resultRowHeight = parseInt(resultRow.css('height'));
+        nameRow.css('height', Math.max(nameRowHeight, resultRowHeight));
+        resultRow.css('height', Math.max(nameRowHeight, resultRowHeight));
+    }
+}
 $(window).ready(
     function () {
         // Hook up the event and run resize ASAP (looks jumpy in FF if you
@@ -16,6 +29,7 @@ 
         $(window).resize(_resize);
         $("#scroller").scrollLeft(100000);
         _resize();
+        _fixRowHeights();
 
         function _submit() {
             $(this).submit();
@@ -124,3 +138,4 @@ 
 // run it again after everything is loaded (things end up wrong in
 // chromium if you don't do this).
 $(window).load(_resize);
+$(window).load(_fixRowHeights);