mirror of
https://github.com/SilenceLurker/ST-Amily2-Chat-Optimisation.git
synced 2026-06-06 12:25:51 +00:00
Add files via upload
This commit is contained in:
@@ -107,6 +107,12 @@ export function updateOrInsertTableInChat() {
|
|||||||
const container = document.createElement('div');
|
const container = document.createElement('div');
|
||||||
container.id = TABLE_CONTAINER_ID;
|
container.id = TABLE_CONTAINER_ID;
|
||||||
container.innerHTML = htmlContent;
|
container.innerHTML = htmlContent;
|
||||||
|
|
||||||
|
// On mobile devices, add a specific class to enable horizontal scrolling via CSS
|
||||||
|
if (isTouchDevice()) {
|
||||||
|
container.classList.add('mobile-table-view');
|
||||||
|
}
|
||||||
|
|
||||||
lastMessage.appendChild(container);
|
lastMessage.appendChild(container);
|
||||||
bindSwipePreventer(container);
|
bindSwipePreventer(container);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ 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 isTouchDevice = () => window.matchMedia('(pointer: coarse)').matches;
|
||||||
|
|
||||||
// More reliable check for mobile layout adjustments
|
|
||||||
const isMobileForScrolling = () => window.innerWidth <= 768;
|
|
||||||
|
|
||||||
const getAllTablesContainer = () => document.getElementById('all-tables-container');
|
const getAllTablesContainer = () => document.getElementById('all-tables-container');
|
||||||
|
|
||||||
let isResizing = false;
|
let isResizing = false;
|
||||||
@@ -1200,12 +1196,6 @@ export function bindTableEvents() {
|
|||||||
if (!panel || panel.dataset.eventsBound) {
|
if (!panel || panel.dataset.eventsBound) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add a specific class for mobile devices to handle scrolling behavior via CSS
|
|
||||||
if (isMobileForScrolling()) {
|
|
||||||
panel.classList.add('mobile-scrolling');
|
|
||||||
}
|
|
||||||
|
|
||||||
log('开始为表格视图绑定交互事件...', 'info');
|
log('开始为表格视图绑定交互事件...', 'info');
|
||||||
const fillingModeRadios = panel.querySelectorAll('input[name="filling-mode"]');
|
const fillingModeRadios = panel.querySelectorAll('input[name="filling-mode"]');
|
||||||
const contextSliderContainer = document.getElementById('context-reading-slider-container');
|
const contextSliderContainer = document.getElementById('context-reading-slider-container');
|
||||||
|
|||||||
Reference in New Issue
Block a user