{"size": 929, "ext": "js", "max_stars_repo_path": "resources/js/modal.js", "max_stars_repo_name": "wmzkot/rvp_portfolios_laravel", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "resources/js/modal.js", "max_issues_repo_name": "wmzkot/rvp_portfolios_laravel", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "resources/js/modal.js", "max_forks_repo_name": "wmzkot/rvp_portfolios_laravel", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 25.1081081081, "max_line_length": 88, "alphanum_fraction": 0.4650161464}
$(function (){
  let fx = {
    'initmodal' : function () {
      if ($('.modal-window').length === 0) {
        $('<div>').attr('id', 'overlay').prependTo('body');
        $('.container').addClass('blured');
        return $('<div>').addClass('modal-window').prependTo('body').css({
          "min-height" : "20vh"
        });
      } else {
        return $('.modal-window');
      }
    }
  }

  $('.more-details').click(function() {
    let id = $(this).attr('data-id');
    let modal = fx.initmodal();
    $('<a>').attr('href', '#').addClass('modal-close').html('&times;').click(function(){
      $('#overlay').remove();
      modal.remove();
      $('.container').removeClass('blured');
    }).appendTo(modal);

    $.ajax({
      type: 'POST',
      url: '/ajax',
      data: {
        "id": id,
      },
      success: function(data){
        modal.append(data);
      },
      error: e=>console.log(e),
    });
  });
});