hideAndResolve = function() {
      // Theme the element and container.
      self._setTheming();

      // Remove offscreen classes and add hidden class.
      self.panelEl.removeClass('_md-panel-offscreen');
      self.innerWrapper.removeClass('_md-panel-offscreen');
      self.panelContainer.addClass(MD_PANEL_HIDDEN);

      resolve(self);
    }
Adds the styles for the panel, such as positioning and z-index. Also,
themes the panel element and panel container using `$mdTheming`.
@returns {!Q.IPromise<!MdPanelRef>}
@private