Detailed description of issue
I’m looking for a way to detect which toolbarGroup the user is currently looking at, or add an event listener for when the user changes toolbar groups and get it that way.
Expected behaviour
When the document loads detect which toolbar group view is active, and or add an event listener for its change.
Code snippet
instance.UI.getToolbarGroup();
or
documentViewer.addEventListener('toolbarGroupChanged');
Unfortunately, there are no APIs to this. However, I put in a request to add this API and we should hopefully have it ready in the next minor release! In the meantime here are some possible workarounds.
This one is the least elegant solution. What we do is every time the tool mode changes (happens when changing the header group) look for the header ribbon that has the class active and get it’s data-element, this is the active header groups name. This doesn’t work when clicking view, most likely cause the tool mode doesn’t get set, so you could all just look for all click events on the viewer and see if the header group has changed too.
Thank you for your patience. I have received approval for this feature request, and it will be in our next minor release, which should hopefully be released sometime this week.