docs.js (Leaflet-1.8.0) | : | docs.js (Leaflet-1.9.0) | ||
---|---|---|---|---|
skipping to change at line 76 | skipping to change at line 76 | |||
}; | }; | |||
scrollPos(); | scrollPos(); | |||
window.addEventListener('scroll', function () { | window.addEventListener('scroll', function () { | |||
scrollPos(); | scrollPos(); | |||
}); | }); | |||
window.addEventListener('load', function () { | window.addEventListener('load', function () { | |||
var currentHash = window.location.hash; | var currentHash = window.location.hash; | |||
if (!currentHash) { return; } | ||||
var elem = document.querySelector(currentHash); | var elem = document.querySelector(currentHash); | |||
if (elem.tagName === 'H2' || elem.tagName === 'H4') { | if (elem.tagName === 'H2' || elem.tagName === 'H4') { | |||
setTimeout(()=>{ | setTimeout(()=>{ | |||
scrollToHeader(elem, true); | scrollToHeader(elem, true); | |||
}, 10); | }, 10); | |||
} | } | |||
}, false); | }, false); | |||
} | } | |||
End of changes. 1 change blocks. | ||||
0 lines changed or deleted | 1 lines changed or added |