Modal toggle not triggering on click in published site

Using cornerstone, I have been able to create a Modal content type with a Raw Content child. When using the Cornerstone editor, the functionality is working correctly. However, once published, the click event does not trigger the addition of the x-active class to the wrapper.

Here is what I have already tried:

  • I have created a clone of the page and eliminated all elements except an example Modal
  • I have eliminated all javascript errors in the console.
  • I confirmed than any javascript console user messages are the same between the admin and public sides
  • I have confirmed that the modal content is added to the page correctly (below the footer), but is hidden via CSS
  • I have confirmed that adding the x-active class to the modal content div does render the modal window

Event Listeners

  • I have confirmed that on the Admin side, the event listeners have been attached (click, keydown, mouseenter, mouseleave, tco-toggle)
  • On the public side, no event listeners are attached to the button div.

Admin Button Div

Button Text

Public Button Div

Button Text

Reviewing the attributes of the divs shows some differences between the admin and public sides. Is there an “on-load” script not running on the public side to attach the listeners? If so, how can I tell where that is?

Public Div:
class=“x-anchor x-anchor-toggle has-graphic e6339-e6 m4w3-9”
tabindex=“0”
role=“button”
data-x-toggle=“1”
data-x-toggleable=“e6339-e6”
data-x-toggle-overlay=“1”
aria-controls=“e6339-e6-modal”
aria-expanded=“false”
aria-haspopup=“true”
aria-label=“Toggle Modal Content”

Admin Div:
aria-label=“Toggle Modal Content”
aria-haspopup=“true”
aria-expanded=“false”
aria-controls=“e6339-cs7-modal”
data-x-toggle-overlay=“1”
data-x-toggleable=“e6339-cs7”
data-x-toggle=“1”
role=“button”
tabindex=“0”
class=“x-anchor x-anchor-toggle has-graphic e6339-cs7 mcs7-0 tco-element-preview”
data-cs-observeable-id=“cs7”
data-cs-observe=“true”

Hey Nik,

Thanks for the very detailed post information. To better assist you with the issue, please provide us with your WP details so that we can investigate the issue further. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.