starting grammar cleanup
This commit is contained in:
@@ -112,14 +112,15 @@ class PageTransitions {
|
||||
if (this.navControl.toggleMenuBtn.classList.contains('active')) {
|
||||
this.navControl.toggleNavMenu();
|
||||
}
|
||||
if (this.isExternalLink(link)) {
|
||||
link.setAttribute('target', '_blank');
|
||||
window.open(link, '_blank');
|
||||
}
|
||||
if (!this.isExternalLink(link)) {
|
||||
if (!this.isExternalLink(link) && this.isWordPressAdminLink(link)) {
|
||||
window.location.href = link.href; // Navigate normally
|
||||
} else if (!this.isExternalLink(link)) {
|
||||
this.animatePageTransition(() => {
|
||||
this.loadContent(link.getAttribute('href'), 'content-container');
|
||||
});
|
||||
} else if (this.isExternalLink(link)) {
|
||||
link.setAttribute('target', '_blank');
|
||||
window.open(link, '_system');
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -186,6 +187,11 @@ class PageTransitions {
|
||||
const linkDomain = link.hostname;
|
||||
return linkDomain !== currentDomain;
|
||||
}
|
||||
isWordPressAdminLink(link) {
|
||||
// Customize the condition based on your WordPress admin URL structure
|
||||
const adminUrlRegex = /^.*\/wp-admin\//;
|
||||
return adminUrlRegex.test(link.href);
|
||||
}
|
||||
}
|
||||
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PageTransitions);
|
||||
|
||||
|
Reference in New Issue
Block a user