-
-
Save anonymous/5e766dcdfda31574ba47 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojolicious/resources/templates/mojo/menubar.html.ep b/lib/Mojolicious/resources/templates/mojo/menubar.html.ep | |
index 26e52bb..b463016 100644 | |
--- a/lib/Mojolicious/resources/templates/mojo/menubar.html.ep | |
+++ b/lib/Mojolicious/resources/templates/mojo/menubar.html.ep | |
@@ -128,12 +128,11 @@ | |
$('.mojoscroll').click(function (e) { | |
e.preventDefault(); | |
e.stopPropagation(); | |
- var anchor = this.href.split('#')[1].replace(/(:|\.|\[|\]|,)/g, "\\$1"); | |
- var hash = '#' + anchor; | |
- var target = $(hash); | |
+ var anchor = this.href.split('#')[1]; | |
+ var target = $($(document.getElementById(anchor))); | |
var old = target.attr('id'); | |
target.attr('id', ''); | |
- location.hash = hash; | |
+ location.hash = '#' + encodeURIComponent(anchor); | |
target.attr('id', old); | |
fixOffset(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment