Browse Source

bug in IE. when a user clicked on a toc item, the href was getting set to include the website name before the #tripal_organism-base-box. a quick regex to detect and remove anything before the # sign fixed the bug.

mestato 13 years ago
parent
commit
f6e509a7b2
1 changed files with 8 additions and 0 deletions
  1. 8 0
      theme_tripal/node-chado_organism.tpl.php

+ 8 - 0
theme_tripal/node-chado_organism.tpl.php

@@ -52,6 +52,14 @@ $organism = $variables['node']->organism;
       $(".tripal_organism_toc_item").click(function(){
          $(".tripal-info-box").hide();
          href = $(this).attr('href');
+         if(href.match(/^#/)){
+            //alert("correct: " + href);
+         }
+         else{
+            tmp = href.replace(/^.*?#/, "#");
+            href = tmp;
+            //alert("fixed: " + href);
+         }
          $(href).fadeIn('slow');
          // we want to make sure our table of contents and the details
          // box stay the same height