Explorar el Código

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 hace 10 años
padre
commit
95b9f702d5
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  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.