소스 검색

Merge pull request #343 from prudloff-insite/anchor

Don't scroll to top of page when closing popin
Amauri CHAMPEAUX 5 년 전
부모
커밋
4ef09977ee
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      tarteaucitron.js

+ 5 - 1
tarteaucitron.js

@@ -802,7 +802,11 @@ var tarteaucitron = {
             "use strict";
 
             if (document.location.hash === tarteaucitron.hashtag) {
-                document.location.hash = '';
+                if (window.history) {
+                    window.history.replaceState('', document.title, window.location.pathname + window.location.search);
+                } else {
+                    document.location.hash = '';
+                }
             }
             tarteaucitron.userInterface.css('tarteaucitron', 'display', 'none');
             tarteaucitron.userInterface.css('tarteaucitronCookiesListContainer', 'display', 'none');