FEATURE: add the ability to zoom in and out using touch screen
This commit is contained in:
parent
71898bff7d
commit
d7a74baa9d
11 changed files with 77 additions and 10 deletions
16
front/src/Touch/TouchScreenManager.ts
Normal file
16
front/src/Touch/TouchScreenManager.ts
Normal file
|
@ -0,0 +1,16 @@
|
|||
|
||||
class TouchScreenManager {
|
||||
|
||||
readonly supportTouchScreen:boolean;
|
||||
|
||||
constructor() {
|
||||
this.supportTouchScreen = this.detectTouchscreen();
|
||||
}
|
||||
|
||||
//found here: https://stackoverflow.com/questions/4817029/whats-the-best-way-to-detect-a-touch-screen-device-using-javascript#4819886
|
||||
detectTouchscreen(): boolean {
|
||||
return (('ontouchstart' in window) || (navigator.maxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0));
|
||||
}
|
||||
}
|
||||
|
||||
export const touchScreenManager = new TouchScreenManager();
|
Loading…
Add table
Add a link
Reference in a new issue