mirror of
https://github.com/misskey-dev/misskey.git
synced 2025-01-07 01:22:51 +01:00
tweak cell selection
This commit is contained in:
parent
b0b474d2a3
commit
173b90e124
1 changed files with 22 additions and 1 deletions
|
@ -455,7 +455,28 @@ function onLeftMouseDown(ev: MouseEvent) {
|
||||||
}
|
}
|
||||||
case 'normal': {
|
case 'normal': {
|
||||||
if (availableCellAddress(cellAddress)) {
|
if (availableCellAddress(cellAddress)) {
|
||||||
selectionCell(cellAddress);
|
if (ev.shiftKey && selectedCell.value && !equalCellAddress(cellAddress, selectedCell.value.address)) {
|
||||||
|
const selectedCellAddress = selectedCell.value.address;
|
||||||
|
|
||||||
|
const leftTop = {
|
||||||
|
col: Math.min(selectedCellAddress.col, cellAddress.col),
|
||||||
|
row: Math.min(selectedCellAddress.row, cellAddress.row),
|
||||||
|
};
|
||||||
|
|
||||||
|
const rightBottom = {
|
||||||
|
col: Math.max(selectedCellAddress.col, cellAddress.col),
|
||||||
|
row: Math.max(selectedCellAddress.row, cellAddress.row),
|
||||||
|
};
|
||||||
|
|
||||||
|
unSelectionRangeAll();
|
||||||
|
expandCellRange(leftTop, rightBottom);
|
||||||
|
|
||||||
|
cells.value[selectedCellAddress.row].cells[selectedCellAddress.col].selected = true;
|
||||||
|
} else {
|
||||||
|
selectionCell(cellAddress);
|
||||||
|
}
|
||||||
|
|
||||||
|
previousCellAddress.value = cellAddress;
|
||||||
|
|
||||||
registerMouseUp();
|
registerMouseUp();
|
||||||
registerMouseMove();
|
registerMouseMove();
|
||||||
|
|
Loading…
Reference in a new issue