Repository navigation
Improve reliability of clean-repo-tabs + more-dropdown-links - #5614
Merged
Merged
Conversation
cheap-glitch
commented
Apr 28, 2022
Comment on lines
+34
to
+47
| function onlyShowInDropdown(id: string): void { | ||
| const tabItem = select(`[data-tab-item$="${id}"]`); | ||
| if (!tabItem && pageDetect.isEnterprise()) { // GHE #3962 | ||
| return; | ||
| } | ||
|
|
||
| (tabItem!.closest('li') ?? tabItem!.closest('.UnderlineNav-item'))!.classList.add('d-none'); | ||
|
|
||
| const menuItem = select(`[data-menu-item$="${id}"]`)!; | ||
| menuItem.removeAttribute('data-menu-item'); | ||
| menuItem.hidden = false; | ||
| // The item has to be moved somewhere else because the overflow nav is order-dependent | ||
| select('.UnderlineNav-actions ul')!.append(menuItem); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
Moved this function over since it's only ever used in this file.
Comment on lines
-50
to
+36
| select('.js-responsive-underlinenav-overflow ul')!.append( | ||
| // Wait for the nav dropdown to be loaded #5244 | ||
| const repoNavigationDropdown = await elementReady('.UnderlineNav-actions ul'); | ||
| repoNavigationDropdown!.append( |
Contributor
Author
There was a problem hiding this comment.
I can very reliably trigger an error on this select, and changing it to an elementReady fixes it.
fregante
approved these changes
Apr 28, 2022
cheap-glitch
marked this pull request as ready for review
May 5, 2022 15:41
clean-repo-tabs and more-dropdown-linksclean-repo-tabs + more-dropdown-links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5244 (hopefully)
Test URLs
Any repo page. The errors are more likely to appear when applying some throttling.
Screenshot
n/a