File tree Expand file tree Collapse file tree
src/NuGetGallery/Scripts/gallery Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9393 var storage = window [ 'localStorage' ] ;
9494 var packageManagerStorageKey = 'preferred_package_manager' ;
9595 var bodyStorageKey = 'preferred_body_tab' ;
96-
97- // The V3 registration API links to the display package page's README using
98- // the 'show-readme-container' URL fragment.
9996 var restorePreferredBodyTab = true ;
100- if ( window . location . hash === '#show-readme-container' ) {
101- $ ( '#readme-body-tab' ) . focus ( ) ;
97+
98+ var windowHash = window . location . hash ;
99+ if ( windowHash ) {
100+ // The V3 registration API links to the display package page's README using
101+ // the 'show-readme-container' URL fragment.
102+ if ( windowHash === '#show-readme-container' ) {
103+ windowHash = '#readme-body-tab' ;
104+ }
105+
106+ $ ( windowHash ) . focus ( ) ;
107+ $ ( windowHash ) . tab ( 'show' ) ;
108+ // don't restore body tab given the window hash
102109 restorePreferredBodyTab = false ;
103110 }
104111
154161 storage . setItem ( bodyStorageKey , e . target . id ) ;
155162 }
156163
164+ window . history . replaceState ( "" , "" , "#" + e . target . id ) ;
165+
157166 clampUsedByDescriptions ( ) ;
158167
159168 window . nuget . sendMetric ( "ShowDisplayPackageTab" , 1 , {
You can’t perform that action at this time.
0 commit comments