smooth things out
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user