Set up tracking of site search for Google Analytics

This commit is contained in:
squidfunk
2016-02-27 12:20:49 +01:00
parent f6195de306
commit c829555313
7 changed files with 30 additions and 10 deletions

View File

@@ -253,7 +253,7 @@ document.addEventListener('DOMContentLoaded', function() {
/* Close search and jump to anchor when on same page */
var parts = link.href.split('#');
if (parts[0] == window.location.href.split('#')[0]) {
if (parts[0] == document.location.href.split('#')[0]) {
link.addEventListener('click', function(e) {
document.body.classList.remove('toggle-search');
document.body.classList.remove('locked');