mirror of
https://github.com/Wx-2025/ST-Amily2-Chat-Optimisation.git
synced 2026-06-07 10:55:51 +00:00
Update table-bindings.js
This commit is contained in:
@@ -12,6 +12,7 @@ import { safeCharLorebooks, safeLorebookEntries } from '../core/tavernhelper-com
|
|||||||
import { characters, this_chid, eventSource, event_types } from "/script.js";
|
import { characters, this_chid, eventSource, event_types } from "/script.js";
|
||||||
import { fetchNccsModels, testNccsApiConnection } from '../core/api/NccsApi.js';
|
import { fetchNccsModels, testNccsApiConnection } from '../core/api/NccsApi.js';
|
||||||
|
|
||||||
|
const isTouchDevice = () => window.matchMedia('(pointer: coarse)').matches;
|
||||||
const getAllTablesContainer = () => document.getElementById('all-tables-container');
|
const getAllTablesContainer = () => document.getElementById('all-tables-container');
|
||||||
|
|
||||||
|
|
||||||
@@ -398,7 +399,6 @@ export function renderTables() {
|
|||||||
const cell = row.insertCell();
|
const cell = row.insertCell();
|
||||||
cell.textContent = cellData;
|
cell.textContent = cellData;
|
||||||
|
|
||||||
const isTouchDevice = () => 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
||||||
if (!isTouchDevice()) {
|
if (!isTouchDevice()) {
|
||||||
cell.setAttribute('contenteditable', 'true');
|
cell.setAttribute('contenteditable', 'true');
|
||||||
}
|
}
|
||||||
@@ -1010,7 +1010,6 @@ export function bindTableEvents() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const isTouchDevice = () => 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
||||||
if (isTouchDevice()) {
|
if (isTouchDevice()) {
|
||||||
let lastTap = 0;
|
let lastTap = 0;
|
||||||
let lastTapTarget = null;
|
let lastTapTarget = null;
|
||||||
@@ -1036,7 +1035,6 @@ export function bindTableEvents() {
|
|||||||
const target = event.target;
|
const target = event.target;
|
||||||
if (target.tagName !== 'TD' || target.getAttribute('contenteditable') !== 'true') return;
|
if (target.tagName !== 'TD' || target.getAttribute('contenteditable') !== 'true') return;
|
||||||
|
|
||||||
const isTouchDevice = () => 'ontouchstart' in window || navigator.maxTouchPoints > 0;
|
|
||||||
if (isTouchDevice()) {
|
if (isTouchDevice()) {
|
||||||
target.setAttribute('contenteditable', 'false');
|
target.setAttribute('contenteditable', 'false');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user