iOS test
This commit is contained in:
parent
ac26d313d4
commit
6468281cf2
2 changed files with 12 additions and 7 deletions
|
@ -1,3 +1,4 @@
|
||||||
|
import{ iOS }from"./login.js";
|
||||||
class Contextmenu<x, y>{
|
class Contextmenu<x, y>{
|
||||||
static currentmenu: HTMLElement | "";
|
static currentmenu: HTMLElement | "";
|
||||||
name: string;
|
name: string;
|
||||||
|
@ -90,13 +91,15 @@ class Contextmenu<x, y>{
|
||||||
this.makemenu(event.clientX, event.clientY, addinfo, other);
|
this.makemenu(event.clientX, event.clientY, addinfo, other);
|
||||||
};
|
};
|
||||||
obj.addEventListener("contextmenu", func);
|
obj.addEventListener("contextmenu", func);
|
||||||
obj.addEventListener("touchstart",(event: TouchEvent)=>{
|
if(iOS){
|
||||||
if(event.touches.length > 1){
|
obj.addEventListener("touchstart",(event: TouchEvent)=>{
|
||||||
event.preventDefault();
|
if(event.touches.length > 1){
|
||||||
event.stopImmediatePropagation();
|
event.preventDefault();
|
||||||
this.makemenu(event.touches[0].clientX, event.touches[0].clientY, addinfo, other);
|
event.stopImmediatePropagation();
|
||||||
}
|
this.makemenu(event.touches[0].clientX, event.touches[0].clientY, addinfo, other);
|
||||||
},{passive:true});
|
}
|
||||||
|
},{passive: false});
|
||||||
|
}
|
||||||
return func;
|
return func;
|
||||||
}
|
}
|
||||||
static keepOnScreen(obj: HTMLElement){
|
static keepOnScreen(obj: HTMLElement){
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import{ Dialog }from"./dialog.js";
|
import{ Dialog }from"./dialog.js";
|
||||||
|
|
||||||
const mobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
const mobile = /iPhone|iPad|iPod|Android/i.test(navigator.userAgent);
|
||||||
|
const iOS = /iPhone|iPad|iPod/i.test(navigator.userAgent);
|
||||||
|
|
||||||
function setTheme(){
|
function setTheme(){
|
||||||
let name = localStorage.getItem("theme");
|
let name = localStorage.getItem("theme");
|
||||||
|
@ -600,6 +601,7 @@ export{ checkInstance };
|
||||||
trimswitcher();
|
trimswitcher();
|
||||||
export{
|
export{
|
||||||
mobile,
|
mobile,
|
||||||
|
iOS,
|
||||||
getBulkUsers,
|
getBulkUsers,
|
||||||
getBulkInfo,
|
getBulkInfo,
|
||||||
setTheme,
|
setTheme,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue