docbrown/app/assets/javascripts/initializers
Marcy Sutton f072730f0f
Header navigation dropdown accessibility (#11509)
* Improve keyboard a11y of header menu dropdown

This commit also includes some cleanup of unnecessary functions that seemed to degrade performance.

Closes https://github.com/forem/forem/issues/1154

* Add temporary focus style on navigation-button

* Put menu items in a list

* Adjust menu button based on VoiceOver testing

* Refactor menu logic to be reusable/work on touch

* Preserve admin link visibility

* Focus on first item on menu open

* Clean up some HTML and CSS

* Apply suggestions from code review

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Ensure menu hides on click outside

* Rename toggle function and adjust formatting

* Update nav button focus style

* Clean up padding on header avatar focus style

* Make button show focus state for keyboard only

Using .focus-visible:focus targets keyboard focus and eliminates a flash of the blue border on click before focus is moved to the child item (which also has no focus style on mouse click)

* Update app/views/layouts/_top_bar.html.erb

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>

* Add some defensive programming

* Removed initializeTouchDevice from base.js.erb

* navigation-butt ID is now member-menu-button

* Moved all the logic from initializeTouchDevice.js into a pack file/utilities.

* committing re-ordered schema after setup

* add tests for initializeTouchDevice

* remove some unneeded html setup

* make sure menu doesn't close if user tabs back from sign out

* Revert "committing re-ordered schema after setup"

This reverts commit a41a1c861cca3b97d8a7b8a99268b8afaae9f028.

* optimized code

* small tweaks, only show outline when focused

Co-authored-by: ludwiczakpawel <ludwiczakpawel@gmail.com>
Co-authored-by: rhymes <rhymes@hey.com>
Co-authored-by: Nick Taylor <nick@dev.to>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2021-01-27 09:39:17 +00:00
..
initializeAllChatButtons.js Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
initializeAllFollowButts.js Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
initializeAllTagEditButtons.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeArchivedPostFilter.js Fixes archived button in dashboard for PWA (#8930) 2020-06-26 11:26:12 -04:00
initializeArticleDate.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeArticleReactions.js Improve styling for series (#9893) 2020-08-24 09:53:51 +02:00
initializeBaseTracking.js.erb Fetch GA Tracking ID from SiteConfig (#10262) 2020-09-09 18:17:44 -04:00
initializeBaseUserData.js Updating navigation (especially mobile) (#10424) 2020-12-08 15:59:21 +01:00
initializeBodyData.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeBroadcast.js Hide active broadcasts from /connect routes (#10312) 2020-09-14 11:28:18 +02:00
initializeColorPicker.js Move the color picker to its own initializer file (#11693) 2020-12-01 15:34:44 +02:00
initializeCommentDate.js Fix lint in initializeCommentDate.js (#4319) [ci skip] 2019-10-09 14:33:52 -04:00
initializeCommentDropdown.js Comments UI update (#11283) 2020-11-18 18:21:19 -05:00
initializeCommentPreview.js Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
initializeCommentsPage.js.erb Improve cumulative layout shift on comment reactions + optimizations (#12309) 2021-01-18 19:29:44 -05:00
initializeCreditsPage.js Refactor: initializeCreditsPage.js (#4312) [ci skip] 2019-10-08 12:33:28 -04:00
initializeDashboardSort.js [deploy] Dashboard updates (#8879) 2020-06-25 13:10:17 -04:00
initializeDateTimeHelpers.js [deploy] Add local_date helper to handle dates with respect of user timezone (#9285) 2020-07-16 08:45:44 -06:00
initializeDrawerSliders.js Remove swipe gestures and other unnecessary code (#12027) 2020-12-30 12:17:29 -05:00
initializeEllipsisMenu.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeHeroBannerClose.js [deploy] Remove hardcoded banner exit code (#7018) 2020-04-02 12:08:13 -04:00
initializeLocalStorageRender.js Replace querySelector and getElementsByTagName when selecting for head and body (#8315) 2020-06-08 20:08:40 -04:00
initializeOnboardingTaskCard.js Fix TypeError: userData is null in initializeOnboardingTaskCard.js (#9298) [deploy] 2020-07-14 07:32:57 -07:00
initializePaymentPointers.js Check for meta payment pointer first before attempting to load (#9722) 2020-08-10 18:12:48 -04:00
initializePodcastPlayback.js Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
initializePWAFunctionality.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeReadingListIcons.js Don't show badge when reading list is left empty (#9437) 2020-07-22 08:55:33 -04:00
initializeSettings.js Layout updates (#8107) 2020-06-04 16:12:17 +02:00
initializeSpecialNavigationFunctionality.js CSS Cleanups, part 2 (#10527) 2020-10-03 06:57:57 +02:00
initializeSponsorshipVisibility.js New sidebar navigation (#7212) 2020-04-15 18:16:33 +02:00
initializeTimeFixer.js Ran prettier on *.js, *.jsx and *.md files. (#11586) 2020-11-23 20:45:50 -05:00
initializeUserProfilePage.js Use faster JS selection methods (#11409) 2020-11-16 17:35:50 +01:00
initializeVideoPlayback.js Podcast + Video player native bridge small refactor (#11345) 2020-11-10 07:36:05 -06:00
initNotifications.js Notifications redesign (#11084) 2020-10-29 20:38:17 +01:00
initScrolling.js Update all followed tag with one click (#11454) 2021-01-05 16:15:37 +01:00
runtime.js Fix the way we check for AndroidBridge global (#11969) 2020-12-18 09:44:53 -06:00