Tweak toggle behaviour

Make sure we only jump to a section an expand it
if the url contains a hash.

Whilst here:
Update all jsdoc documentation so `make jscsdoc` doesn't
throw an errors for this file.

Bug: T76316
Change-Id: Ic8e34e4b4a6e08fe3342a1e85d96f1e9a18dbf63
Merge "Tweak toggle behaviour"