From: Alexander Ebert Date: Fri, 8 Mar 2013 19:16:29 +0000 (+0100) Subject: Automatically rewriting WCF::getAnchor() to current page X-Git-Tag: 2.0.0_Beta_1~433^2~2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b95fdaea00f6bb528002306fa7219b1bd03ff7aa;p=GitHub%2FWoltLab%2FWCF.git Automatically rewriting WCF::getAnchor() to current page --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 6d8a8067d4..7353f78aa6 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1611,6 +1611,16 @@ WCF.Action.Proxy = Class.extend({ // disable DOMNodeInserted event WCF.DOMNodeInsertedHandler.disable(); + + // fix anchor tags generated through WCF::getAnchor() + $('a[href*=#]').each(function(index, link) { + var $link = $(link); + if ($link.prop('href').indexOf('AJAXProxy')) { + var $anchor = $link.prop('href').substr($link.prop('href').indexOf('#')); + var $pageLink = document.location.toString().replace(/#.*/, ''); + $link.prop('href', $pageLink + $anchor); + } + }); }, /**