I looked at doing the change that way before I settled on this way - it's definitely possible (and straightforward), but I went for the simpler / smaller change.  The thing that particularly pushed me away from that method was that getting the room constructs a Room object / running a bunch of jquery selectors that won't be used for anything.

I'm happy to change the PR to do this (getting the data-name attribute from the tab, constructing the room, testing whether it matches the lobby) if this one fails for readability reasons though of course.