How do we check whether the html page in Adobe Experience Manager/CQ5 is opened in touch mode or classic mode?
You can add dependency to /libs/wcm/foundation/components/utils/AuthoringUtils.js
and then call AuthoringUtils.isTouch
and AuthoringUtils.isClassic
to check whether it is currently in touch or the classic mode. For e.g., your JS Use API would look something like below.
"use strict";
use(["/libs/wcm/foundation/components/utils/AuthoringUtils.js"], function (AuthoringUtils) {
if (AuthoringUtils.isTouch) {
// do something
} else {
// do something else
}
// rest of the things
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With