Skip to content

Commit 2cbe2be

Browse files
committed
make table header not sticky
1 parent 12e0336 commit 2cbe2be

File tree

3 files changed

+1
-29
lines changed

3 files changed

+1
-29
lines changed

src/gitGraphView.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,6 @@ export class GitGraphView extends Disposable {
736736
<div id="commitTable"></div>
737737
</div>
738738
<div id="footer"></div>
739-
<div id="scrollShadow"></div>
740739
</div>
741740
<script nonce="${nonce}">var initialState = ${JSON.stringify(initialState)}, globalState = ${JSON.stringify(globalState)}, workspaceState = ${JSON.stringify(workspaceState)};</script>
742741
<script nonce="${nonce}" src="${this.getMediaUri('out.min.js')}"></script>

web/main.ts

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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>' : '') +
@@ -1987,16 +1984,6 @@ class GitGraphView {
19871984
if (!this.tableColHeadersElem) {
19881985
return;
19891986
}
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`;
20001987
}
20011988

20021989

@@ -2064,12 +2051,10 @@ class GitGraphView {
20642051

20652052
private observeViewScroll() {
20662053
let active = this.viewElem.scrollTop > 0, timeout: NodeJS.Timer | null = null;
2067-
this.scrollShadowElem.className = active ? CLASS_ACTIVE : '';
20682054
this.viewElem.addEventListener('scroll', () => {
20692055
const scrollTop = this.viewElem.scrollTop;
20702056
if (active !== scrollTop > 0) {
20712057
active = scrollTop > 0;
2072-
this.scrollShadowElem.className = active ? CLASS_ACTIVE : '';
20732058
}
20742059

20752060
if (this.config.loadMoreCommitsAutomatically && this.moreCommitsAvailable && !this.currentRepoRefreshState.inProgress) {

web/styles/main.css

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ code{
6969
cursor:col-resize;
7070
}
7171

72-
#scrollShadow.active{
73-
position:fixed;
74-
top:0;
75-
left:0;
76-
right:0;
77-
height:6px;
78-
box-shadow: inset 0 6px 6px -6px var(--vscode-scrollbar-shadow);
79-
z-index:11;
80-
pointer-events:none;
81-
}
82-
83-
8472
/* Commit Graph */
8573

8674
#commitGraph{

0 commit comments

Comments
 (0)