<commit_before>import {Component, ElementRef, HostListener, Inject, Input, OnInit} from '@angular/core';
import {Contributor} from '../../model/contributor';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog';

interface ContributorDialogData{
  contributor: Contributor;
}

@Component({
  selector: 'app-contributor-card',
  templateUrl: './contributor-card.component.html',
  styleUrls: ['./contributor-card.component.css']
})
export class ContributorCardComponent implements OnInit {

  @HostListener('document:click',['$event'])
  clickout(event){
    if(this.clickoutHandler){
      this.clickoutHandler(event);
    }
  }

  clickoutHandler: Function;

  dialogRef: MatDialogRef<ContributorDialogComponent>;

  @Input()
  contributor: Contributor;
  @Input()
  noAvatar: boolean = false;
  constructor(public dialog: MatDialog) { }

  openDialog(): void{
    setTimeout(() => {
      this.dialogRef = this.dialog.open(ContributorDialogComponent,{
        hasBackdrop: false,
        minWidth: '150px',
        data:{contributor: this.contributor}

      });

      this.dialogRef.afterOpened().subscribe(()=>{
        this.clickoutHandler = this.closeDialogFromClickout;
      });
    });
  }

  closeDialogFromClickout(event: MouseEvent){
    if (!this.dialogRef.componentInstance)return;
    const matDialogContainer = this.dialogRef.componentInstance.hostElement.nativeElement.parentElement;
    const rect = matDialogContainer.getBoundingClientRect();
    if(event.clientX <= rect.left || event.clientX >= rect.right || event.clientY <= rect.top || event.clientY >= rect.bottom){
      this.dialogRef.close();
    }
  }

<commit_msg>added backdrop(darkening) to contributor card<commit_after>import {Component, ElementRef, HostListener, Inject, Input, OnInit} from '@angular/core';
import {Contributor} from '../../model/contributor';
import {MAT_DIALOG_DATA, MatDialog, MatDialogRef} from '@angular/material/dialog';

interface ContributorDialogData{
  contributor: Contributor;
}

@Component({
  selector: 'app-contributor-card',
  templateUrl: './contributor-card.component.html',
  styleUrls: ['./contributor-card.component.css']
})
export class ContributorCardComponent implements OnInit {

  @HostListener('document:click',['$event'])
  clickout(event){
    if(this.clickoutHandler){
      this.clickoutHandler(event);
    }
  }

  clickoutHandler: Function;

  dialogRef: MatDialogRef<ContributorDialogComponent>;

  @Input()
  contributor: Contributor;
  @Input()
  noAvatar: boolean = false;
  constructor(public dialog: MatDialog) { }

  openDialog(): void{
    setTimeout(() => {
      this.dialogRef = this.dialog.open(ContributorDialogComponent, {
        minWidth: '150px',
        data:{contributor: this.contributor}

      });

      this.dialogRef.afterOpened().subscribe(()=>{
        this.clickoutHandler = this.closeDialogFromClickout;
      });
    });
  }

  closeDialogFromClickout(event: MouseEvent){
    if (!this.dialogRef.componentInstance)return;
    const matDialogContainer = this.dialogRef.componentInstance.hostElement.nativeElement.parentElement;
    const rect = matDialogContainer.getBoundingClientRect();
    if(event.clientX <= rect.left || event.clientX >= rect.right || event.clientY <= rect.top || event.clientY >= rect.bottom){
      this.dialogRef.close();
    }
  }


{'fraction_non_alphanumeric': 0.13488510892270963, 'fraction_numerical': 0.0017905102954341987, 'mean_word_length': 4.354632587859425, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1091953', 'n_tokens_mistral': 1010, 'n_tokens_neox': 978, 'n_words': 174}