_handlePjaxEvent(event, gitmasterEventName, pjaxEventName) {
    // Avoid re-entrance, which would blow the callstack. Because dispatchEvent() is synchronous, it's possible
    // for badly implemented handler from another extension to prevent legit event handling if users navigate
    // among files too quickly. Hopefully none is that bad. We'll deal with it IFF it happens.
    if (this._isDispatching) {
      return;
    }
    this._isDispatching = true;

    try {
      $(document).trigger(gitmasterEventName);

      // Only dispatch to native DOM if the event is started by gitmaster. If the event is started in the DOM, jQuery
      // wraps it in the originalEvent property, that's what we use to check. Fixes #864.
      if (event.originalEvent === null) {
        this._dispatchPjaxEventInDom(pjaxEventName);
      }
    } finally {
      this._isDispatching = false;
    }
  }
Event handler of pjax events.
@api private