Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] syntax error of non-english character #2042

Merged
merged 2 commits into from
Feb 8, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ $(document).ready(function() {
var smoothScrolling = false;
$(window).bind("popstate", function (event) {
$.smoothScroll({
scrollTarget: location.hash,
scrollTarget: decodeURI(location.hash),
offset: -20,
beforeScroll: function() { smoothScrolling = true; },
afterScroll: function() { smoothScrolling = false; }
Expand All @@ -74,7 +74,7 @@ $(document).ready(function() {
}
});
// Smooth scroll on page load if there is a hash in the URL.
if (location.hash) {
aliwo marked this conversation as resolved.
Show resolved Hide resolved
if (decodeURI(location.hash)) {
$(window).trigger("popstate");
}

Expand Down Expand Up @@ -103,13 +103,13 @@ $(document).ready(function() {
if (top <= scrollTop && scrollTop < bottom) {
// Mark all ancestors as active
links[i].link.parents("li").children("a").addClass('active');
if (links[i].href !== location.hash) {
if (links[i].href !== decodeURI(location.hash)) {
history.replaceState(null, null, links[i].href);
}
return;
}
}
if ('#' !== location.hash) {
aliwo marked this conversation as resolved.
Show resolved Hide resolved
if ('#' !== decodeURI(location.hash)) {
history.replaceState(null, null, '#');
}
}));
Expand Down