feature: Add script to tag external links to open in new tab and add class for styling

This commit is contained in:
Keith Solomon
2025-11-11 11:30:48 -06:00
parent 06f714f7c3
commit aae6608153
2 changed files with 56 additions and 13 deletions

View File

@@ -5,6 +5,7 @@
import { registerButtonComponent } from './components/button.js';
import { registerBackToTopButton } from './components/backToTop.js';
import GetHeaderHeight from './modules/GetHeaderHeight.js';
import tagExternalLinks from './modules/TagExternalLinks.js';
import Navigation from './modules/Navigation.js';
// Add passive event listeners
@@ -50,23 +51,26 @@ import Navigation from './modules/Navigation.js';
* Application entrypoint
*/
document.addEventListener('DOMContentLoaded', () => {
// Register button component
registerButtonComponent();
registerBackToTopButton();
// Tag external links
tagExternalLinks();
// Initialize Navigation
const navigation = new Navigation('navMainToggle', '.menu-vdi__toggle');
// Register button component
registerButtonComponent();
registerBackToTopButton();
// Initialize Navigation
navigation.desktopMenuDropdowns();
navigation.mobileMenuToggle();
// Initialize Navigation
const navigation = new Navigation('navMainToggle', '.menu-vdi__toggle');
// Initialize Header Height
GetHeaderHeight();
// Initialize Navigation
navigation.desktopMenuDropdowns();
navigation.mobileMenuToggle();
// Add Back to Top button to body
const backToTop = document.createElement('back-to-top');
document.body.appendChild(backToTop);
// Initialize Header Height
GetHeaderHeight();
// Add Back to Top button to body
const backToTop = document.createElement('back-to-top');
document.body.appendChild(backToTop);
});
console.log(`theme.js loaded.`);