Expand my Community achievements bar.

Accessing page properties inside touch ui listeners

Avatar

Community Advisor

Hi,

I want to hide couple of dialog tabs for a specific template instead of creating new component for this template.

Can we get the cq:template or sling:resourceType property inside touch ui listeners?

Below is my listener:

(function (document, $) {

  "use strict";

// listen for dialog injection

  $(document).on("foundation-contentloaded", function (e) {

    $(".coral-TabPanel-navigation").find(".coral-TabPanel-tab").each(function (index, element) {

        var tabTitle = $( this ).text();

        if(tabTitle == 'Tab 3')

        {

               $( this ).addClass('hide');

        }

});

  });

})(document, Granite.$);

1 Reply

Avatar

Community Advisor

I placed the above code in a clientlib and try to load it in edit mode on my custom template but its not loading this script.