Quellcode durchsuchen

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 vor 13 Jahren
Ursprung
Commit
f6e509a7b2
1 geänderte Dateien mit 8 neuen und 0 gelöschten Zeilen
  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