fixing closing button behaviour
This commit is contained in:
parent
cf2bf7ac6b
commit
932620e27b
2 changed files with 4 additions and 3 deletions
|
@ -2,8 +2,8 @@
|
||||||
async function loadContent(sectionId, contentFile) {
|
async function loadContent(sectionId, contentFile) {
|
||||||
try {
|
try {
|
||||||
console.log(`Loading content for ${sectionId} from ${contentFile}`);
|
console.log(`Loading content for ${sectionId} from ${contentFile}`);
|
||||||
// Use relative path instead of absolute path
|
// Use correct relative path
|
||||||
const response = await fetch(`../content/${contentFile}`);
|
const response = await fetch(`/content/${contentFile}`);
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
throw new Error(`HTTP error! status: ${response.status}`);
|
throw new Error(`HTTP error! status: ${response.status}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -298,7 +298,8 @@
|
||||||
|
|
||||||
// Handle the × button click
|
// Handle the × button click
|
||||||
$this.find('button.close').on('click', function(event) {
|
$this.find('button.close').on('click', function(event) {
|
||||||
event.stopPropagation(); // Prevent the click from bubbling to the article
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
location.hash = '';
|
location.hash = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue