@@ -56,7 +56,6 @@ class GitGraphView {
5656 private readonly footerElem : HTMLElement ;
5757 private readonly showRemoteBranchesElem : HTMLInputElement ;
5858 private readonly refreshBtnElem : HTMLElement ;
59- private readonly scrollShadowElem : HTMLElement ;
6059
6160 constructor ( viewElem : HTMLElement , prevState : WebViewState | null ) {
6261 this . gitRepos = initialState . repos ;
@@ -78,7 +77,6 @@ class GitGraphView {
7877 this . tableElem = document . getElementById ( 'commitTable' ) ! ;
7978 this . tableColHeadersElem = document . getElementById ( 'tableColHeaders' ) ! ;
8079 this . footerElem = document . getElementById ( 'footer' ) ! ;
81- this . scrollShadowElem = < HTMLInputElement > document . getElementById ( 'scrollShadow' ) ! ;
8280
8381 viewElem . focus ( ) ;
8482
@@ -855,8 +853,7 @@ class GitGraphView {
855853 markdown : this . config . markdown
856854 } ) ;
857855
858- const stickyClassAttr = this . config . stickyHeader ? ' class="sticky"' : '' ;
859- let html = '<tr id="tableColHeaders"' + stickyClassAttr + '><th id="tableHeaderGraphCol" class="tableColHeader" data-col="0">Graph</th><th class="tableColHeader" data-col="1">Description</th>' +
856+ let html = '<tr id="tableColHeaders"><th id="tableHeaderGraphCol" class="tableColHeader" data-col="0">Graph</th><th class="tableColHeader" data-col="1">Description</th>' +
860857 ( colVisibility . date ? '<th class="tableColHeader dateCol" data-col="2">Date</th>' : '' ) +
861858 ( colVisibility . author ? '<th class="tableColHeader authorCol" data-col="3">Author</th>' : '' ) +
862859 ( colVisibility . commit ? '<th class="tableColHeader" data-col="4">Commit</th>' : '' ) +
@@ -904,11 +901,16 @@ class GitGraphView {
904901 : '' ;
905902
906903 html += '<tr class="commit' + ( commit . hash === currentHash ? ' current' : '' ) + ( mutedCommits [ i ] ? ' mute' : '' ) + '"' + ( commit . hash !== UNCOMMITTED ? '' : ' id="uncommittedChanges"' ) + ' data-id="' + i + '" data-color="' + vertexColours [ i ] + '">' +
907- ( this . config . referenceLabels . branchLabelsAlignedToGraph ? '<td>' + ( refBranches !== '' ? '<span style="margin-left:' + ( widthsAtVertices [ i ] - 4 ) + 'px"' + refBranches . substring ( 5 ) : '' ) + '</td><td><span class="description">' + commitDot : '<td></td><td><span class="description">' + commitDot + refBranches ) + ( this . config . referenceLabels . tagLabelsOnRight ? message + refTags : refTags + message ) + '</span></td>' +
908- ( colVisibility . date ? '<td class="dateCol text" title="' + date . title + '">' + date . formatted + '</td>' : '' ) +
909- ( colVisibility . author ? '<td class="authorCol text" title="' + escapeHtml ( commit . author + ' <' + commit . email + '>' ) + '">' + ( this . config . fetchAvatars ? '<span class="avatar" data-email="' + escapeHtml ( commit . email ) + '">' + ( typeof this . avatars [ commit . email ] === 'string' ? '<img class="avatarImg" src="' + this . avatars [ commit . email ] + '">' : '' ) + '</span>' : '' ) + escapeHtml ( commit . author ) + '</td>' : '' ) +
910- ( colVisibility . commit ? '<td class="text" title="' + escapeHtml ( commit . hash ) + '">' + abbrevCommit ( commit . hash ) + '</td>' : '' ) +
904+ ( this . config . referenceLabels . branchLabelsAlignedToGraph ? '<td>' + getResizeColHtml ( 0 ) + ( refBranches !== '' ? '<span style="margin-left:' + ( widthsAtVertices [ i ] - 4 ) + 'px"' + refBranches . substring ( 5 ) : '' ) + '</td><td>' + getResizeColHtml ( 1 ) + ' <span class="description">' + commitDot : '<td>' + getResizeColHtml ( 0 ) + ' </td><td>' + getResizeColHtml ( 1 ) + ' <span class="description">' + commitDot + refBranches ) + ( this . config . referenceLabels . tagLabelsOnRight ? message + refTags : refTags + message ) + '</span></td>' +
905+ ( colVisibility . date ? '<td class="dateCol text" title="' + date . title + '">' + getResizeColHtml ( 2 ) + date . formatted + '</td>' : '' ) +
906+ ( colVisibility . author ? '<td class="authorCol text" title="' + escapeHtml ( commit . author + ' <' + commit . email + '>' ) + '">' + getResizeColHtml ( 3 ) + ( this . config . fetchAvatars ? '<span class="avatar" data-email="' + escapeHtml ( commit . email ) + '">' + ( typeof this . avatars [ commit . email ] === 'string' ? '<img class="avatarImg" src="' + this . avatars [ commit . email ] + '">' : '' ) + '</span>' : '' ) + escapeHtml ( commit . author ) + '</td>' : '' ) +
907+ ( colVisibility . commit ? '<td class="text" title="' + escapeHtml ( commit . hash ) + '">' + getResizeColHtml ( 4 ) + abbrevCommit ( commit . hash ) + '</td>' : '' ) +
911908 '</tr>' ;
909+
910+
911+ }
912+ function getResizeColHtml ( col :number ) {
913+ return ( col > 0 ? '<span class="resizeCol left" data-col="' + ( col - 1 ) + '"></span>' : '' ) + ( col < 4 ? '<span class="resizeCol right" data-col="' + col + '"></span>' : '' ) ;
912914 }
913915 this . tableElem . innerHTML = '<table>' + html + '</table>' ;
914916 this . footerElem . innerHTML = this . moreCommitsAvailable ? '<div id="loadMoreCommitsBtn" class="roundedBtn">Load More Commits</div>' : '' ;
@@ -1987,16 +1989,6 @@ class GitGraphView {
19871989 if ( ! this . tableColHeadersElem ) {
19881990 return ;
19891991 }
1990-
1991- const controlsHeight = this . controlsElem . offsetHeight ;
1992- const controlsWidth = this . controlsElem . offsetWidth ;
1993- const tableColHeadersHeight = this . tableColHeadersElem . offsetHeight ;
1994- const bottomBorderWidth = 1 ;
1995- const shadowYPos = controlsHeight + tableColHeadersHeight + bottomBorderWidth ;
1996-
1997- this . tableColHeadersElem . style . top = `${ controlsHeight } px` ;
1998- this . scrollShadowElem . style . top = `${ shadowYPos } px` ;
1999- this . scrollShadowElem . style . width = `${ controlsWidth } px` ;
20001992 }
20011993
20021994
@@ -2064,12 +2056,10 @@ class GitGraphView {
20642056
20652057 private observeViewScroll ( ) {
20662058 let active = this . viewElem . scrollTop > 0 , timeout : NodeJS . Timer | null = null ;
2067- this . scrollShadowElem . className = active ? CLASS_ACTIVE : '' ;
20682059 this . viewElem . addEventListener ( 'scroll' , ( ) => {
20692060 const scrollTop = this . viewElem . scrollTop ;
20702061 if ( active !== scrollTop > 0 ) {
20712062 active = scrollTop > 0 ;
2072- this . scrollShadowElem . className = active ? CLASS_ACTIVE : '' ;
20732063 }
20742064
20752065 if ( this . config . loadMoreCommitsAutomatically && this . moreCommitsAvailable && ! this . currentRepoRefreshState . inProgress ) {
0 commit comments