summaryrefslogtreecommitdiff
path: root/source/features/table-input.tsx
diff options
context:
space:
mode:
authorGravatar Federico Brigante <me@fregante.com> 2023-11-09 19:22:34 +0800
committerGravatar GitHub <noreply@github.com> 2023-11-09 19:22:34 +0800
commitbccc37b757e87ef9c3def6fbb5786ed174600ed8 (patch)
tree0fccfdac0bdb00a46ccf937316de52cc78d3d848 /source/features/table-input.tsx
parent831e9a9159d9f7ab94b543f606e94f30609291ea (diff)
downloadrefined-github-bccc37b757e87ef9c3def6fbb5786ed174600ed8.tar.gz
refined-github-bccc37b757e87ef9c3def6fbb5786ed174600ed8.tar.zst
refined-github-bccc37b757e87ef9c3def6fbb5786ed174600ed8.zip
`table-input`/`collapsible-content-button` - Silence Firefox (#7042)
Diffstat (limited to '')
-rw-r--r--source/features/table-input.tsx12
1 files changed, 3 insertions, 9 deletions
diff --git a/source/features/table-input.tsx b/source/features/table-input.tsx
index bdc44bf0..f271201e 100644
--- a/source/features/table-input.tsx
+++ b/source/features/table-input.tsx
@@ -34,12 +34,6 @@ function addTable({delegateTarget: square}: DelegateEvent<MouseEvent, HTMLButton
field.selectionEnd = field.value.indexOf('<td>', cursorPosition) + '<td>'.length;
}
-function highlightSquares({delegateTarget: hover}: DelegateEvent<MouseEvent, HTMLElement>): void {
- for (const cell of hover.parentElement!.children as HTMLCollectionOf<HTMLButtonElement>) {
- cell.classList.toggle('selected', cell.dataset.x! <= hover.dataset.x! && cell.dataset.y! <= hover.dataset.y!);
- }
-}
-
function add(anchor: HTMLElement): void {
const wrapperClasses = [
'details-reset',
@@ -111,12 +105,12 @@ function init(signal: AbortSignal): void {
'.ActionBar-item:has([data-md-button=\'ref\'])',
], add, {signal});
delegate('.rgh-tic', 'click', addTable, {signal});
- if (!isHasSelectorSupported()) {
- delegate('.rgh-tic', 'mouseenter', highlightSquares, {capture: true, signal});
- }
}
void features.add(import.meta.url, {
+ asLongAs: [
+ isHasSelectorSupported,
+ ],
include: [
pageDetect.hasRichTextEditor,
],