From 6c03dd74af6b620c299f23eb63250ce5130e1a75 Mon Sep 17 00:00:00 2001 From: Noritaka IZUMI <38166104+noritakaIzumi@users.noreply.github.com> Date: Sat, 14 Nov 2020 02:51:58 +0900 Subject: Fix smooth scroll (#164) The function addSmoothScroll causes an error if a target link contains multibyte characters. Decoding `this.hash` can prevent. --- static/assets/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'static') diff --git a/static/assets/js/main.js b/static/assets/js/main.js index c02f237..47c0886 100644 --- a/static/assets/js/main.js +++ b/static/assets/js/main.js @@ -37,7 +37,7 @@ var isMobile = false, isTablet = false, isLaptop = false; location.hostname == this.hostname ) { // Figure out element to scroll to - var target = $(this.hash); + var target = $(decodeURI(this.hash)); target = target.length ? target : $('[name=' + this.hash.slice(1) + ']'); // Does a scroll target exist? if (target.length) { -- cgit v1.2.3