Closed moity closed 9 years ago
becomeMaster
only fires on the tab that is now turning into the master. tabPromoted
is the event that's fired on every tab when a tab is promoted to master.
if you're trying to do some kind of resource setup, then becomeMaster
is the right event to use.
OK, cheers. I am trying to have one persistent connection to the server for realtime (signalr). Still need to check the initial state on page load as to whether the page is master or not as no becomeMaster
will fire in that scenario right?
becomeMaster event should always fire, but it's potentially possible that it's firing before you bind something to it.
I notice that the
becomeMaster
event doesn't seem to work as expected, it doesn't necessarily fire when a tab becomes master.I also notice that your sample
crosstab\samples\index.html
doesn't use thebecomeMaster
event, instead it looks at thetabPromoted
andtabUpdated
events and updates the state of the UI (after asetTimeout
) to the new state.I would have thought the
becomeMaster
event would be the only event I would need to subscribe to for knowledge of who the master is (unless I specifically wanted to know when a tab was updated).