Fire onViewChange once after cookie plugin

Hello,

I am using scheduler.attachEvent(“onViewChange”) to trigger correct highlighting of scheduler buttons.

However when i use the “Cookies” plugin this event fires 2 or 3 times. Unfortunately this means that all of the buttons whos views have been switched during initialization get highlighted.

How can I fire this event, only once the final view has been decided by the cookie plugin?

Thanks,
Tim

Hi,
from the event handler you can’t know, whether it is the last event in a row, or if will be one more.
If you do manual highlighting of tabs, you need to clear previous state before highlighting a new selected item (remove the related css class from all tabs).
In that case you shouldn’t have issues if the active view is changed multiple times