Scope $() searches to the current ModalBar

For #6617. The problem there was that when the new ModalBar opens, the old ModalBar isn't done closing yet, and so `$()` searches for DOM elements were finding items in the old ModalBar rather than the new one. This scopes them to the new ModalBar.