code: function hide() {
      var immediate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
      var element = this.element,
          options = this.options;
  
  
      if (options.inline || this.hiding || !(this.isShown || this.showing)) {
        return this;
      }
  
      if (isFunction(options.hide)) {
        addListener(element, EVENT_HIDE, options.hide, {
          once: true
        });
      }
  
      if (dispatchEvent(element, EVENT_HIDE) === false) {
        return this;
      }
  
      if (this.showing) {
        this.transitioning.abort();
      }
  
      this.hiding = true;
  
      if (this.played) {
        this.stop();
      } else if (this.viewing) {
        this.viewing.abort();
      }
  
      var viewer = this.viewer;
  
  
      if (options.transition && !immediate) {
        var hidden = this.hidden.bind(this);
        var hide = function hide() {
          addListener(viewer, EVENT_TRANSITION_END, hidden, {
            once: true
          });
          removeClass(viewer, CLASS_IN);
        };
  
        this.transitioning = {
          abort: function abort() {
            if (this.viewed) {
              removeListener(this.image, EVENT_TRANSITION_END, hide);
            } else {
              removeListener(viewer, EVENT_TRANSITION_END, hidden);
            }
          }
        };
  
        if (this.viewed) {
          addListener(this.image, EVENT_TRANSITION_END, hide, {
            once: true
          });
          this.zoomTo(0, false, false, true);
        } else {
          hide();
        }
      } else {
        removeClass(viewer, CLASS_IN);
        this.hidden();
      }
  
      return this;
    }
docs: Hide the viewer (only available in modal mode)
  @param {boolean} [immediate=false] - Indicates if hide the viewer immediately or not.
  @returns {Viewer} this