Preview Rendered JS Event Not Including CSS/JS Changes

I see from your developer docs that I can listen to rendering elements like so:

Preview rendered

@since Cornerstone 7.5.11

The JS event cs-preview-render will dispatch every time Cornerstone has had a change with it’s document. This can be useful if your custom element should resize based on a possible change to the document.

window.addEventListener('cs-preview-render', function() {
  console.log('Cornerstone has rendered');
});

However, this does not fire when there are page or global CSS/JS updates. Is there a separate listener for those?

I can make sure the event triggers on the Global / Document CSS code editors.

The JS editors are actually not added to the page directly until the page is reloaded again. You can press the “Run” button to preview changes right away in that case.

Have a great day.

1 Like

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