Touch UI v/s Classic UI in AEM
Asked Answered
D

1

10

How do we check whether the html page in Adobe Experience Manager/CQ5 is opened in touch mode or classic mode?

Doreathadoreen answered 29/10, 2015 at 9:2 Comment(2)
You want to check this in Sightly ?Disunion
sightly will do. Or any other method.Doreathadoreen
D
9

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
}
Disunion answered 29/10, 2015 at 9:46 Comment(1)
Kindly consider accepting the answer in case it was helpfulDisunion

© 2022 - 2024 — McMap. All rights reserved.