Fix context menu when event page goes inactive

The onClick listener needs to be registered whenever the event page is
loaded. Registering it just when the context menu entries are created
means the listener is lost when the event page goes inactive.