#1005 Replace mobile detection method in get sortable delay. Make deviceInfo loading sync. Init Ross mods via function call.

This commit is contained in:
Cohee
2023-08-24 23:52:03 +03:00
parent ce67101651
commit 1900ab9726
6 changed files with 55 additions and 52 deletions

View File

@ -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;
}
/**