소스 검색

Fix smooth scroll (#164)

The function addSmoothScroll causes an error if a target link contains multibyte characters.
Decoding `this.hash` can prevent.
Noritaka IZUMI 4 년 전
부모
커밋
6c03dd74af
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      static/assets/js/main.js

+ 1 - 1
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) {