🐞 fix: Clean up code for production use
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* Add Focus Styling Back
|
||||
* -
|
||||
* On the first "Tab" key press, remove the "zero/hidden" styling of the outline for :focus states.
|
||||
*/
|
||||
|
||||
function AddFocusStylingBack() {
|
||||
function addFocusStylingBack(event) {
|
||||
if (event.key == "Tab") { document.body.classList.add('keyboard-navigation'); }
|
||||
|
||||
document.removeEventListener("keydown", addFocusStylingBack);
|
||||
}
|
||||
|
||||
document.addEventListener("keydown", addFocusStylingBack);
|
||||
}
|
||||
|
||||
export default AddFocusStylingBack;
|
||||
@@ -4,7 +4,6 @@
|
||||
|
||||
import { registerButtonComponent } from './components/button.js';
|
||||
import { registerBackToTopButton } from './components/backToTop.js';
|
||||
import AddFocusStylingBack from './modules/FocusStyling.js';
|
||||
import GetHeaderHeight from './modules/GetHeaderHeight.js';
|
||||
import Navigation from './modules/Navigation.js';
|
||||
|
||||
@@ -62,8 +61,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
navigation.desktopMenuDropdowns();
|
||||
navigation.mobileMenuToggle();
|
||||
|
||||
// Initialize Focus Styling and Header Height
|
||||
AddFocusStylingBack();
|
||||
// Initialize Header Height
|
||||
GetHeaderHeight();
|
||||
|
||||
// Add Back to Top button to body
|
||||
|
||||
Reference in New Issue
Block a user