-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #170 from usegalaxy-au/dev
About page and FGENESH form updates
- Loading branch information
Showing
8 changed files
with
138 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Scroll to an element with a custom offset when clicking on anchor links with | ||
// hash navigation. This prevents the browser from scrolling past the target | ||
// element. | ||
|
||
const OFFSET = -120; // Set offset from scroll target (px) | ||
|
||
function scrollToElementWithOffset(elementId) { | ||
const targetElement = document.getElementById(elementId); | ||
|
||
if (targetElement) { | ||
const elementPosition = | ||
targetElement.getBoundingClientRect().top + window.scrollY; | ||
window.scrollTo({ | ||
top: elementPosition + OFFSET, | ||
behavior: "smooth", | ||
}); | ||
} | ||
} | ||
|
||
// Handle clicks on anchor links with hash navigation | ||
document.querySelectorAll("a").forEach((link) => { | ||
if (link.getAttribute("href").startsWith("#")) { | ||
link.addEventListener("click", function (event) { | ||
event.preventDefault(); | ||
const targetId = this.getAttribute("href").substring(1); | ||
scrollToElementWithOffset(targetId); | ||
window.location.hash = targetId; | ||
}); | ||
} | ||
}); | ||
|
||
// Handle URL hash change (for direct navigation to #elementId) | ||
window.addEventListener("hashchange", function () { | ||
const hash = window.location.hash.substring(1); | ||
scrollToElementWithOffset(hash); | ||
}); | ||
|
||
// Scroll on page load if the URL contains a hash | ||
window.addEventListener("load", function () { | ||
const hash = window.location.hash.substring(1); | ||
if (hash) { | ||
scrollToElementWithOffset(hash); | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -319,7 +319,6 @@ def test_it_can_handle_request_for_fgenesh_access(self): | |
'email': '[email protected]', | ||
'agree_terms': 'on', | ||
'agree_acknowledge': 'on', | ||
'matrices': [genematrix_tree.as_choices()[0][0]], | ||
}) | ||
self.assert_access_form_success(response, auto_action=False) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters