Forked from
UNL Information Services / UNL-CMS
796 commits behind the upstream repository.
-
Tim Steiner authored
git-svn-id: file:///tmp/wdn_thm_drupal/trunk@304 20a16fea-79d4-4915-8869-1ea9d5ebf173
Tim Steiner authoredgit-svn-id: file:///tmp/wdn_thm_drupal/trunk@304 20a16fea-79d4-4915-8869-1ea9d5ebf173
theme.js 700 B
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];
});
});