@@ -64,7 +64,7 @@ $(function () {
6464
6565 // Configure expanders
6666 window . nuget . configureExpanderHeading ( "dependency-groups" ) ;
67- window . nuget . configureExpanderHeading ( "github-usage " ) ;
67+ window . nuget . configureExpanderHeading ( "used-by " ) ;
6868 window . nuget . configureExpanderHeading ( "version-history" ) ;
6969 window . nuget . configureExpander (
7070 "hidden-versions" ,
@@ -121,12 +121,12 @@ $(function () {
121121 ga ( 'send' , 'event' , 'dependencies' , e . type ) ;
122122 } ) ;
123123
124- // Emit a Google Analytics event when the user expands or collapses the GitHub Usage section.
125- $ ( "#github-usage " ) . on ( 'hide.bs.collapse show.bs.collapse' , function ( e ) {
126- ga ( 'send' , 'event' , 'github-usage ' , e . type ) ;
124+ // Emit a Google Analytics event when the user expands or collapses the Used By section.
125+ $ ( "#used-by " ) . on ( 'hide.bs.collapse show.bs.collapse' , function ( e ) {
126+ ga ( 'send' , 'event' , 'used-by ' , e . type ) ;
127127 } ) ;
128128
129- // Emit a Google Analytics event when the user clicks on a repo link in the GitHub Usage section.
129+ // Emit a Google Analytics event when the user clicks on a repo link in the GitHub Repos area of the Used By section.
130130 $ ( ".gh-link" ) . on ( 'click' , function ( elem ) {
131131 if ( ! elem . delegateTarget . dataset . indexNumber ) {
132132 console . error ( "indexNumber property doesn't exist!" ) ;
@@ -135,28 +135,15 @@ $(function () {
135135 ga ( 'send' , 'event' , 'github-usage' , 'link-click-' + linkIndex ) ;
136136 }
137137 } ) ;
138- }
139-
140- // Add smooth scrolling to dependent-repos-link
141- $ ( "#dependent-repos-link" ) . on ( 'click' , function ( event ) {
142- // Emit a Google Analytics event
143- if ( window . nuget . isGaAvailable ( ) ) {
144- ga ( 'send' , 'event' , 'github-usage' , 'sidebar-link-click' ) ;
145- }
146138
147- if ( this . hash !== "" ) {
148- event . preventDefault ( ) ;
149- var hash = this . hash ;
150- var hashElem = $ ( hash ) ;
151- if ( hashElem . attr ( "aria-expanded" ) == "false" ) {
152- hashElem . click ( ) ;
139+ // Emit a Google Analytics event when the user clicks on a package link in the NuGet Packages area of the Used By section.
140+ $ ( ".ngp-link" ) . on ( 'click' , function ( elem ) {
141+ if ( ! elem . delegateTarget . dataset . indexNumber ) {
142+ console . error ( "indexNumber property doesn't exist!" ) ;
143+ } else {
144+ var linkIndex = elem . delegateTarget . dataset . indexNumber ;
145+ ga ( 'send' , 'event' , 'used-by-packages' , 'link-click-' + linkIndex ) ;
153146 }
154- $ ( 'html, body' ) . animate ( {
155- scrollTop : hashElem . offset ( ) . top
156- } , 400 , function ( ) {
157- // Add hash (#) to URL when done scrolling (default click behavior)
158- window . location . hash = hash ;
159- } ) ;
160- }
161- } ) ;
147+ } ) ;
148+ }
162149} ) ;
0 commit comments