mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 23:43:57 +00:00
fixed header fixes
This commit is contained in:
@@ -9,6 +9,7 @@
|
|||||||
import _, { range } from 'lodash';
|
import _, { range } from 'lodash';
|
||||||
import { onMount } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { prop_dev, tick } from 'svelte/internal';
|
import { prop_dev, tick } from 'svelte/internal';
|
||||||
|
import resizeObserver from '../utility/resizeObserver';
|
||||||
|
|
||||||
export let root: PerspectiveTreeNode;
|
export let root: PerspectiveTreeNode;
|
||||||
let dataRows;
|
let dataRows;
|
||||||
@@ -87,9 +88,11 @@
|
|||||||
const sourceCells = domTableHead.querySelectorAll('th');
|
const sourceCells = domTableHead.querySelectorAll('th');
|
||||||
const targetCells = theadClone.querySelectorAll('th');
|
const targetCells = theadClone.querySelectorAll('th');
|
||||||
domHeaderWrap.appendChild(theadClone);
|
domHeaderWrap.appendChild(theadClone);
|
||||||
for (const [src, dst] of _.zip(sourceCells, targetCells)) {
|
for (const pair of _.zip(sourceCells, targetCells)) {
|
||||||
// @ts-ignore
|
const [src, dst]: [any, any] = pair;
|
||||||
dst.style.width = `${src.getBoundingClientRect().width}px`;
|
dst.style.width = `${src.getBoundingClientRect().width - 1}px`;
|
||||||
|
dst.style.minWidth = `${src.getBoundingClientRect().width - 1}px`;
|
||||||
|
dst.style.maxWidth = `${src.getBoundingClientRect().width - 1}px`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,9 +107,11 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="headerWrap" bind:this={domHeaderWrap} />
|
<div class="headerWrap">
|
||||||
|
<table bind:this={domHeaderWrap} />
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="wrapper" bind:this={domWrapper}>
|
<div class="wrapper" bind:this={domWrapper} use:resizeObserver={true} on:resize={createHeaderClone}>
|
||||||
{#if display}
|
{#if display}
|
||||||
<table>
|
<table>
|
||||||
<thead bind:this={domTableHead}>
|
<thead bind:this={domTableHead}>
|
||||||
|
|||||||
Reference in New Issue
Block a user