How do we check whether the html page in Adobe Experience Manager/CQ5 is opened in touch mode or classic mode?
Touch UI v/s Classic UI in AEM
You want to check this in Sightly ? –
Disunion
sightly will do. Or any other method. –
Doreathadoreen
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
}
Kindly consider accepting the answer in case it was helpful –
Disunion
© 2022 - 2024 — McMap. All rights reserved.