Highlighted

Accessing page properties inside touch ui listeners

Singaiah_Chintalapudi

MVP

21-03-2018

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.$);

Replies

Highlighted

Singaiah_Chintalapudi

MVP

21-03-2018

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.