How to hide labels when going from Edit mode to Preview mode?
Let's say I have a label like
<p class="my-label" data-sly-test="${wcmmode.edit}">A useful label</p>I find this type of label useful because in edit mode, it can indicate things to authors. When switching to Preview mode however, the label does not disappear. It only disappears when I do a page refresh. I've got a listener like,
channel.on('cq-layer-activated', function (event) {...});that can force the page refresh, but to me this is not elegant. How can the component refresh itself when switching between modes?
Maybe a better question is, how can I add overlays to my component such that they only appear during authoring?
Thanks!