@@ -78,9 +78,8 @@ async function renderSidebarHTML() {
7878 sidebarLogo . innerText = repoName ;
7979
8080 // scroll to start of repo name
81- sidebarLogo . scrollTo ( {
82- left : 0 ,
83- } ) ;
81+ sidebarLogo . scrollTo ( 0 , 0 ) ;
82+ scrolledSidebarTitle ( ) ;
8483
8584 // change header options
8685 header . classList . remove ( 'out-of-repo' ) ;
@@ -173,9 +172,8 @@ async function renderSidebarHTML() {
173172 sidebarLogo . innerText = 'Repositories' ;
174173
175174 // scroll to start of repo name
176- sidebarLogo . scrollTo ( {
177- left : 0 ,
178- } ) ;
175+ sidebarLogo . scrollTo ( 0 , 0 ) ;
176+ scrolledSidebarTitle ( ) ;
179177
180178 renderSidebarHTML ( ) ;
181179
@@ -210,9 +208,8 @@ async function renderSidebarHTML() {
210208 sidebarLogo . innerText = repoName ;
211209
212210 // scroll to start of repo name
213- sidebarLogo . scrollTo ( {
214- left : 0
215- } ) ;
211+ sidebarLogo . scrollTo ( 0 , 0 ) ;
212+ scrolledSidebarTitle ( ) ;
216213
217214 // change header options
218215 header . classList . remove ( 'out-of-repo' ) ;
@@ -370,19 +367,15 @@ async function renderSidebarHTML() {
370367 }
371368
372369 // scroll to start of repo name
373- sidebarLogo . scrollTo ( {
374- left : 0 ,
375- } ) ;
370+ sidebarLogo . scrollTo ( 0 , 0 ) ;
376371
377372 } else {
378373
379374 // show title
380375 sidebarLogo . innerText = 'Repositories' ;
381376
382377 // scroll to start of repo name
383- sidebarLogo . scrollTo ( {
384- left : 0 ,
385- } ) ;
378+ sidebarLogo . scrollTo ( 0 , 0 ) ;
386379
387380 }
388381
@@ -723,9 +716,8 @@ function addHTMLItemListeners() {
723716 sidebarLogo . innerText = repoLoc [ 1 ] ;
724717
725718 // scroll to start of repo name
726- sidebarLogo . scrollTo ( {
727- left : 0
728- } ) ;
719+ sidebarLogo . scrollTo ( 0 , 0 ) ;
720+ scrolledSidebarTitle ( ) ;
729721
730722 // change header options
731723 header . classList . remove ( 'out-of-repo' ) ;
@@ -1446,8 +1438,10 @@ sidebarTitle.addEventListener('click', (e) => {
14461438// show gradients on edges of sidebar title
14471439// when scrolling long titles
14481440
1449- sidebarLogo . addEventListener ( 'scroll' , ( ) => {
1441+ sidebarLogo . addEventListener ( 'scroll' , scrolledSidebarTitle ) ;
14501442
1443+ function scrolledSidebarTitle ( ) {
1444+
14511445 if ( sidebarLogo . scrollLeft > 0 ) {
14521446
14531447 sidebarLogo . classList . add ( 'scrolled-start' ) ;
@@ -1468,8 +1462,8 @@ sidebarLogo.addEventListener('scroll', () => {
14681462 sidebarLogo . classList . remove ( 'scrolled-end' ) ;
14691463
14701464 }
1471-
1472- } )
1465+
1466+ }
14731467
14741468
14751469// if clicked on branch icon,
0 commit comments