Commit ccc26487 authored by Eric Rasmussen's avatar Eric Rasmussen
Browse files

[gh-546] Remove unl_wdn theme.js and move functionality to unl module

So that the base tag/anchor fix works on admin pages
parent e657cd3c
......@@ -23,3 +23,27 @@ jQuery('document').ready(function() {
};
});
jQuery('document').ready(function() {
// if there's no base tag on the page, we don't have to worry about this
if (jQuery('base').length == 0) {
return;
}
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];
});
});
WDN.loadJQuery(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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment