Detecting Touch Devices - carstenschaefer/ImagerJs GitHub Wiki
Specifies the function that ImagerJs calls to determine whether it's running on a touch device.
Configuration
imager: {
detectTouch: function() {
// Your code goes here
}
}
- This function must return true or false.
- If the function returns
true
, ImagerJs assumes it runs on a touch device and will …- adjust its toolbar size (see property toolbarSizeTouch)
- use touch-optimized settings for object control (see property objectControlsTouch)
- add touch events
- If this function is not specified explicitly, ImagerJs will use its own touch detection mechanism.
Disabling Touch Detection
To disable touch detection entirely, simply return false
from the detectTouch
function:
detectTouch: function() {
return false;
}