Skip to content

Commit

Permalink
fix(core/forms): hide file preview in read only mode w/ null value
Browse files Browse the repository at this point in the history
  • Loading branch information
trik committed Jun 3, 2020
1 parent f645e0b commit 843e280
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/core/forms/read-only-file-field.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<a [href]="fileUrl|async" [download]="fileName|async">
<a *ngIf="fileUrl|async as fu ; else noFile" [href]="fu" [download]="fileName|async">
<img [src]="fileIcon"> {{ fileName|async }}
</a>
<ng-template #noFile>
<div class="ajf-no-file-placeholder"></div>
</ng-template>
6 changes: 6 additions & 0 deletions src/core/forms/read-only-file-field.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,10 @@ ajf-read-only-file-field {
margin-right: 8px;
vertical-align: middle;
}

.ajf-no-file-placeholder {
width: 100%;
height: 32px;
background-color: #eeeeee;
}
}

0 comments on commit 843e280

Please sign in to comment.