浏览代码

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 年之前
父节点
当前提交
4cd2667aa5
共有 1 个文件被更改,包括 2 次插入4 次删除
  1. 2 4
      theme_tripal/node-chado_library.tpl.php

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

@@ -34,8 +34,7 @@ $library  = $variables['node']->library;
 } else { ?>
 
 <script type="text/javascript">
-if (Drupal.jsEnabled) {
-   $(document).ready(function() {
+   Drupal.behaviors.libraryBehavior = function (context){
       // hide all tripal info boxes at the start
       $(".tripal-info-box").hide();
  
@@ -73,8 +72,7 @@ if (Drupal.jsEnabled) {
       }
 
       $("#tripal_library_toc").height($("#tripal_library-base-box").parent().height());
-   });
-}
+   };
 </script>
 
 <div id="tripal_library_details" class="tripal_details">