Parcourir la source

Changing from $(document).ready to extending Drupal.behaviors as suggested here http://drupal.org/node/304258. $(document).ready does not seem to work on some Drupal 6 installations.

mestato il y a 13 ans
Parent
commit
b7e69b894b
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      theme_tripal/node-chado_organism.tpl.php

+ 2 - 4
theme_tripal/node-chado_organism.tpl.php

@@ -34,8 +34,7 @@ $organism = $variables['node']->organism;
 } else { ?>
 
 <script type="text/javascript">
-if (Drupal.jsEnabled) {
-   $(document).ready(function() {
+   Drupal.behaviors.organismBehavior = function (context){
       // hide all tripal info boxes at the start
       $(".tripal-info-box").hide();
  
@@ -78,8 +77,7 @@ if (Drupal.jsEnabled) {
 
       $("#tripal_organism_toc").height($("#tripal_organism-base-box").parent().height());
       
-   });
-}
+   };
 </script>