Note: After publishing, you may have to bypass your browser's cache to see the changes.
- Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
- Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
- Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
- Opera: Press Ctrl-F5.
function attachModifiedClickHandler(element) {
const handlers = jQuery._data(element, 'events')?.click;
if (handlers && handlers.length > 0) {
const originalHandler = handlers[0].handler;
$(element).off('click').on('click', function(event) {
event.stopPropagation();
originalHandler.call(this, event);
});
element.classList.add('FixCatTreeClick');
}
}
addOnLoadHandler(function() {
const observer = new MutationObserver((mutations) => {
mutations.forEach((mutation) => {
const target = mutation.target;
if (
mutation.attributeName === 'class' &&
target.classList.contains('CategoryTreeToggleHandlerAttached') &&
!target.classList.contains('FixCatTreeClick')
) {
attachModifiedClickHandler(target);
}
});
});
observer.observe(document.body, {
attributes: true,
attributeFilter: ['class'],
subtree: true
});
});