mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
#1005 Replace mobile detection method in get sortable delay. Make deviceInfo loading sync. Init Ross mods via function call.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { getContext } from "./extensions.js";
|
||||
import { getRequestHeaders } from "../script.js";
|
||||
import { isMobile } from "./RossAscends-mods.js";
|
||||
|
||||
/**
|
||||
* Pagination status string template.
|
||||
@ -38,10 +39,10 @@ export function isDigitsOnly(str) {
|
||||
|
||||
/**
|
||||
* Gets a drag delay for sortable elements. This is to prevent accidental drags when scrolling.
|
||||
* @returns {number} The delay in milliseconds. 100ms for desktop, 750ms for mobile.
|
||||
* @returns {number} The delay in milliseconds. 50ms for desktop, 750ms for mobile.
|
||||
*/
|
||||
export function getSortableDelay() {
|
||||
return navigator.maxTouchPoints > 0 ? 750 : 100;
|
||||
return isMobile() ? 750 : 50;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user