Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Touch UI v/s Classic UI in AEM

Tags:

aem

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

like image 949
Nainy Jain Avatar asked Oct 29 '15 09:10

Nainy Jain


1 Answers

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
}
like image 81
rakhi4110 Avatar answered Sep 28 '22 08:09

rakhi4110