فهرست منبع

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 سال پیش
والد
کامیت
95b9f702d5
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  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.