Browse Source

Feature admin summary: fixed small bug pertaining to bar/svg width and added defaults to prevent against total collapse if there happens to be another bug in this calculation.

Lacey Sanderson 10 năm trước cách đây
mục cha
commit
95b9f702d5
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  1. 4 1
      tripal_feature/theme/js/tripalFeature.adminChart.js

+ 4 - 1
tripal_feature/theme/js/tripalFeature.adminChart.js

@@ -44,10 +44,13 @@ Drupal.behaviors.tripalFeature_adminSummaryChart = {
           maxTypeLength = element.name.length;
         }
 
-        if(element.total_features.length > maxTypeLength){
+        if(element.total_features.length > maxTotalLength){
           maxTotalLength = element.total_features.length;
         }
       }
+      // Ensure a minimum in case something goes wrong...
+      if (maxTotalLength < 4) { maxTotalLength = 4; }
+      if (maxTypeLength < 10) { maxTypeLength = 10; }
 
       // Adjust our bottom margin based on the length of type names in the data.
       // Assume 4px/character based on the slope of the label.