Reset mouse events for palette nodes


I have a diagram that makes use of a palette.
The palette shares the templates used by the diagram.
The templates are attached with mouseEnter and mouseLeave event handlers.
I would like to have the handlers working in the diagram but not in the palette.
Could you let me know an easy way to do that?
You can find an example here:
Thanks in advance!

Your event handler(s) could check whether it’s operating in a Palette or not:
function (e, …) {
if (e.diagram instanceof go.Palette) return;
. . .

Thanks a lot! That worked fine