function doRemove() {
            self._$root.remove();
            result.resolve();
        }
Closes the modal bar and returns focus to the active editor. Returns a promise that is
resolved when the bar is fully closed and the container is removed from the DOM.
@param {boolean=} restoreScrollPos If true (the default), adjust the scroll position
    of the editor to account for the ModalBar disappearing. If not set, the caller
    should do it immediately on return of this function (before the animation completes),
    because the editor will already have been resized. Note that this is ignored if
    `prepareClose()` was already called (you need to pass the parameter to that
    function if you call it first).
@param {boolean=} animate If true (the default), animate the closing of the ModalBar,
    otherwise close it immediately.
@param {string=} _reason For internal use only.
@return {$.Promise} promise resolved when close is finished