/*
 * Copyright (c) 2020, FusionAuth, All Rights Reserved
 */

FusionAuth = FusionAuth || {};
FusionAuth.Admin = FusionAuth.Admin || {};
FusionAuth.Admin.Connector = FusionAuth.Admin.Connector || {};

/**
 * @constructor
 */
FusionAuth.Admin.Connector.Index = function() {
  Prime.Utils.bindAll(this);
  Prime.Document.query('a[href="/ajax/connector/types"]').addEventListener('click', this._handleAddClick);
};

FusionAuth.Admin.Connector.Index.constructor = FusionAuth.Admin.Connector.Index;
FusionAuth.Admin.Connector.Index.prototype = {

  /* ===================================================================================================================
   * Private methods
   * ===================================================================================================================*/

  _handleAddClick: function(event) {
    Prime.Utils.stopEvent(event);
    var uri = new Prime.Document.Element(event.currentTarget).getAttribute('href');
    new Prime.Widgets.AJAXDialog().open(uri);
  }
};

