Skip to content

Commit 5a7a6cf

Browse files
committed
update js
Signed-off-by: George Lemon <georgelemon@protonmail.com>
1 parent f0f0ca8 commit 5a7a6cf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/storage/assets/app.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/storage/client/app.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export default {
5252
document.addEventListener('click', (e) => {
5353
const a = e.target.closest('a');
5454
if (a && a.href && a.origin === location.origin && !a.hasAttribute('download') &&
55-
!a.target && !a.href.startsWith('mailto:') && !a.href.startsWith('tel:')) {
55+
!a.target && !a.href.startsWith('mailto:') && !a.href.startsWith('tel:') && !a.getAttribute('href').startsWith('#')) {
5656
e.preventDefault();
5757
// checking if the clicked element is part of the navigaiton menu
5858
// if so, we want to make the clicked item active and remove active from others
@@ -99,6 +99,7 @@ export default {
9999
const navbar = document.querySelector('.navbar-container-area');
100100
const navbarHeight = navbar ? navbar.offsetHeight : 0;
101101
const target = document.getElementById(hash);
102+
console.log(target)
102103
if (target) {
103104
const targetPosition = target.getBoundingClientRect().top + window.pageYOffset;
104105
window.scrollTo({
@@ -268,6 +269,9 @@ document.addEventListener('DOMContentLoaded', () => {
268269
}
269270
});
270271

272+
// Initial syntax highlighting for code blocks
273+
hljs.highlightAll();
274+
271275
const toggleAreaBtns = document.querySelectorAll('button[data-toggle-area]');
272276
const mainArea = document.querySelector('div[data-area="main"]');
273277
const leftSidebar = document.querySelector('div[data-area="left"]');

0 commit comments

Comments
 (0)