Skip to content

Commit

Permalink
Update edit-project.js
Browse files Browse the repository at this point in the history
  • Loading branch information
davetaz authored Oct 8, 2024
1 parent 9c1f270 commit 96e647f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion private/js/edit-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ function updateHash(activityId) {
} else {
location.hash = activityId;
}

const element = document.getElementById(activityId);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
}

function toggleNav() {
Expand Down Expand Up @@ -516,4 +521,4 @@ window.addEventListener('hashchange', () => {
});

// Debounced version of saveProgress
const debouncedSaveProgress = debounce(saveProgress, 2000);
const debouncedSaveProgress = debounce(saveProgress, 2000);

0 comments on commit 96e647f

Please sign in to comment.