mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Play UI: row numbers; cell selection; hysteresis
This commit is contained in:
parent
653b86d1e6
commit
64a1b0f2b8
@ -293,7 +293,6 @@
|
||||
max-width: none;
|
||||
background-color: var(--table-hover-color);
|
||||
border: 2px solid var(--border-color);
|
||||
display: block;
|
||||
}
|
||||
|
||||
td.transposed
|
||||
@ -852,19 +851,6 @@
|
||||
|
||||
const start_time = performance.now();
|
||||
|
||||
function tdMouseEnter(e) {
|
||||
let elem = e.target;
|
||||
elem.classList.add('td-hover-hysteresis');
|
||||
elem.onmouseleave = _ => {
|
||||
setTimeout(() => { elem && elem.classList.remove('td-hover-hysteresis') }, 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function tdClick(e) {
|
||||
let elem = e.target;
|
||||
elem.classList.add('td-selected');
|
||||
}
|
||||
|
||||
let tbody = document.createElement('tbody');
|
||||
for (let row_idx in response.data) {
|
||||
let tr = document.createElement('tr');
|
||||
@ -877,8 +863,15 @@
|
||||
for (let col_idx in response.data[row_idx]) {
|
||||
let cell = response.data[row_idx][col_idx];
|
||||
const td = renderCell(cell, col_idx, settings);
|
||||
td.onmouseenter = tdMouseEnter;
|
||||
td.onclick = tdClick;
|
||||
|
||||
td.onclick = () => { td.classList.add('td-selected') };
|
||||
td.onmouseenter = () => {
|
||||
td.classList.add('td-hover-hysteresis');
|
||||
td.onmouseleave = () => {
|
||||
setTimeout(() => { td && td.classList.remove('td-hover-hysteresis') }, 1000);
|
||||
};
|
||||
};
|
||||
|
||||
tr.appendChild(td);
|
||||
}
|
||||
tbody.appendChild(tr);
|
||||
|
Loading…
Reference in New Issue
Block a user