aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/shared-forms/markdown-textarea.component.html
blob: 5d355a6d89c6f9cd2d3c74f83b05fac6027e02bd (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                           
 
                     
                                                           
                                                                 
                                      
                              

             
                                                          

                                                            
 








                                                      
                                   


                                             
 




                                                                                                                     


                                  

                                                                                 
      
<div class="root" [ngClass]="{ 'maximized': isMaximized }">

  <textarea #textarea
    [(ngModel)]="content" (ngModelChange)="onModelChange()"
    class="form-control" [ngClass]="{ 'input-error': formError }"
    [attr.disabled]="disabled || null"
    [id]="name" [name]="name">
  </textarea>

  <div ngbNav #nav="ngbNav" class="nav-pills nav-preview">
    <ng-container ngbNavItem *ngIf="truncate !== undefined">
      <a ngbNavLink i18n>Truncated preview</a>

      <ng-template ngbNavContent>
        <div [innerHTML]="truncatedPreviewHTML"></div>
      </ng-template>
    </ng-container>

    <ng-container ngbNavItem>
      <a ngbNavLink i18n>Complete preview</a>

      <ng-template ngbNavContent>
        <div #previewElement></div>
        <div [innerHTML]="previewHTML"></div>
      </ng-template>
    </ng-container>

    <button (click)="onMaximizeClick()" class="maximize-button border-0 m-3" [disabled]="disabled">
      <my-global-icon *ngIf="!isMaximized" [ngbTooltip]="maximizeInText" iconName="fullscreen"></my-global-icon>

      <my-global-icon *ngIf="isMaximized" [ngbTooltip]="maximizeOutText" iconName="exit-fullscreen"></my-global-icon>
    </button>
  </div>

  <div [ngbNavOutlet]="nav"></div>

  <div *ngIf="!isMaximized && formError" class="form-error">{{ formError }}</div>
</div>