I wonder if it would actually be any cleaner if this were actually folded into the ModalBar.close() API -- i.e. by default it just shifts the scroll enough to help the bar disappear seamlessly, but a caller could pass in an alternative scroll pos to "restore" instead.  That would let the timing be more centrally orchestrated.  (For example, it's probably fairly fragile right now that the scroll pos is both recorded & restored when the ModalBar is in the same state, thus preventing having to offet the scrollTop when restoring... seems easily breakable as long as this remains outside of ModalBar's knowledge).