diff --git a/sites/all/themes/unl_wdn/theme.js b/sites/all/themes/unl_wdn/theme.js new file mode 100644 index 0000000000000000000000000000000000000000..3e5cae46e96267ad859e0d265728c093857404d2 --- /dev/null +++ b/sites/all/themes/unl_wdn/theme.js @@ -0,0 +1,24 @@ +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 diff --git a/sites/all/themes/unl_wdn/unl_wdn.info b/sites/all/themes/unl_wdn/unl_wdn.info index 591390930e491a963bfa84896665a39b30dc4175..4354e7f27c8f521ef10016f97ab76976e5ed6cf2 100644 --- a/sites/all/themes/unl_wdn/unl_wdn.info +++ b/sites/all/themes/unl_wdn/unl_wdn.info @@ -6,6 +6,8 @@ engine = phptemplate stylesheets[all][] = style.css +scripts[] = theme.js + features[] = main_menu features[] = name features[] = node_user_picture