Skip to content
Snippets Groups Projects
Commit a406a9d2 authored by Tim Steiner's avatar Tim Steiner
Browse files

Add a fix to make #tags work when a base tag exists on the page.

git-svn-id: file:///tmp/wdn_thm_drupal/trunk@304 20a16fea-79d4-4915-8869-1ea9d5ebf173
parent 0b8b8e19
No related branches found
No related tags found
No related merge requests found
WDN.jQuery(document).ready(function () {
// if there's no base tag on the page, we don't have to worry about this
if (WDN.jQuery('base').length == 0) {
return;
}
WDN.jQuery('a').click(function(e){
// if this link has a hash tag
if (this.href.split('#')[1] == '') {
return;
}
// and it is specifically for this page
if (this.getAttribute('href').split('#')[0] != '') {
return;
}
// and something else hasn't already customized the link
if (e.isDefaultPrevented()) {
return;
}
// fix clicking the link so that it ignores the base tag
e.preventDefault();
document.location.hash = this.href.split('#')[1];
});
});
\ No newline at end of file
......@@ -6,6 +6,8 @@ engine = phptemplate
stylesheets[all][] = style.css
scripts[] = theme.js
features[] = main_menu
features[] = name
features[] = node_user_picture
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment