smooth things out

This commit is contained in:
prospect
2024-01-19 10:41:25 -05:00
parent 9ee2bd992c
commit 672b1e6d4a
3 changed files with 12 additions and 33 deletions

View File

@@ -119,7 +119,7 @@ class PageTransitions {
});
} else if (this.isExternalLink(link)) {
link.setAttribute('target', '_blank');
window.open(link, '_system');
window.open(link.href, '_system');
}
});
});
@@ -177,6 +177,12 @@ class PageTransitions {
this.updateContent(data, elementId);
history.pushState(null, null, targetUrl);
// Trigger removal of transition class after fetching data
const contentContainer = document.getElementById(elementId);
setTimeout(() => {
this.removeTransitionClass(contentContainer);
}, 300);
// Update the page title
const newTitle = parsedData.querySelector('title');
if (newTitle) {
@@ -187,12 +193,6 @@ class PageTransitions {
this.collapsePanel = new _CollapsePanel__WEBPACK_IMPORTED_MODULE_0__["default"]();
this.collapsePanel.addToggleCollapseListener('#content-container .accordion-toggle');
this.addLinkClickListener('#content-container a');
// Trigger removal of transition class after fetching data
const contentContainer = document.getElementById(elementId);
setTimeout(() => {
this.removeTransitionClass(contentContainer);
}, 300);
}).catch(error => console.error('Error submitting form:', error));
}
updateContent(data, elementId) {
@@ -203,7 +203,9 @@ class PageTransitions {
const newContent = targetElement.innerHTML;
// Update the content container
contentContainer.innerHTML = newContent;
// Trigger removal of transition class after fetching data
setTimeout(() => {
this.removeTransitionClass(contentContainer);