Commits

Jun Omae  committed ecc1faf

0.12.3dev: fixed the broken `location.hash` when clicking a second-level directory on IE 6 and 7.

A part of #10121 (commentticket10121:14).

  • Participants
  • Parent commits 807578a

Comments (0)

Files changed (1)

File trac/htdocs/js/expand_dir.js

     var a = expander.next("a");
     if ( !autoexpand ) {
       var pathname = window.location.pathname;
-      var entry_href = a.attr("href");
+      // strip scheme and hostname, href is absolute with IE 6 and 7.
+      var entry_href = a.attr("href").replace(/^[^:]+:\/\/[^\/]+/, '');
       // normalize (PATH_INFO possibly has squashed "/")
       pathname = pathname.replace(/\/+/g, '/').replace(/\/$/, '');
       entry_href = entry_href.replace(/\/+/g, '/');