Pages

Friday, 20 December 2013

Disable Sidekick panel in Adobe CQ/AEM

In your script portion of a component, get the sidekick instance and disable the components panel.
 

Before:                                      After:

 



 
Below is the script used to disable Sidekick panel:

<script type="text/javascript">
    window.sidekickComponent = window.SidekickComponent || {};
    sidekickComponent.HideSidekickPanel  = {
        IN_ID : '',
        disableFn: function(){
            try{
                var sideKick = CQ.WCM.getSidekick();
                if(!sideKick){
                    return;
                }
                var compTab = sideKick.panels["COMPONENTS"];
                if (compTab) {
                    compTab.setDisabled(true);
                    clearInterval(sidekickComponent.HideSidekickPanel .IN_ID);
                }
            }catch(err){
                console.log("Error:--" + err);
            }
        }
    }

    CQ.Ext.onReady(function(){
        var h = sidekickComponent.HideSidekickPanel ;
        h.IN_ID = setInterval(h.disableFn, 500);
    });
</script>
 

No comments:

Post a Comment

Converting InputStream to String

    private String convertToString(InputStream inputStreamObj)             throws IOException {         if (inputStreamObj != null) {     ...