mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-16 20:53:59 +02:00
Merge commit 'a024bc7d76fcc5e49e8210f9b0896db9ef21861a'
This commit is contained in:
16
docs/assets/js/head-early.js
Normal file
16
docs/assets/js/head-early.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { scrollToActive } from 'js/helpers/index';
|
||||
|
||||
(function () {
|
||||
// Now we know that the browser has JS enabled.
|
||||
document.documentElement.classList.remove('no-js');
|
||||
|
||||
// Add os-macos class to body if user is using macOS.
|
||||
if (navigator.userAgent.indexOf('Mac') > -1) {
|
||||
document.documentElement.classList.add('os-macos');
|
||||
}
|
||||
|
||||
// Wait for the DOM to be ready.
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
scrollToActive('DOMContentLoaded');
|
||||
});
|
||||
})();
|
Reference in New Issue
Block a user