Преглед на файлове

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">