소스 검색

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 13 년 전
부모
커밋
b7e69b894b
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  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>