在AEM中触摸UI v/s Classic UI

Nai*_*ain 10 aem

我们如何检查Adobe Experience Manager/CQ5中的html页面是以触摸模式还是经典模式打开?

rak*_*110 9

您可以添加依赖关系/libs/wcm/foundation/components/utils/AuthoringUtils.js然后调用AuthoringUtils.isTouchAuthoringUtils.isClassic检查它当前是否处于联系状态或经典模式.例如,您的JS Use API看起来如下所示.

"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
}
Run Code Online (Sandbox Code Playgroud)