projects
/
GitHub
/
WoltLab
/
WCF.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
38fc45a
)
Automatically rewriting WCF::getAnchor() to current page
author
Alexander Ebert
<ebert@woltlab.com>
Fri, 8 Mar 2013 19:16:29 +0000
(20:16 +0100)
committer
Alexander Ebert
<ebert@woltlab.com>
Fri, 8 Mar 2013 19:16:29 +0000
(20:16 +0100)
wcfsetup/install/files/js/WCF.js
patch
|
blob
|
blame
|
history
diff --git
a/wcfsetup/install/files/js/WCF.js
b/wcfsetup/install/files/js/WCF.js
index 6d8a8067d47656745775beeab2933e88b1b76113..7353f78aa67acb4617c32286317dcefd1fc5a5b3 100755
(executable)
--- 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);
+ }
+ });
},
/**