mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
79597: Add input to toggle thumbnail max-width
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
<div class="thumbnail">
|
||||
<img *ngIf="src !== null" [src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()" class="img-fluid"/>
|
||||
<div *ngIf="src === null" class="outer">
|
||||
<div [ngClass]="{ 'thumbnail': true, 'limit-width': limitWidth }">
|
||||
<img *ngIf="src !== null" class="thumbnail-content img-fluid"
|
||||
[src]="src | dsSafeUrl" [alt]="alt | translate" (error)="errorHandler()"/>
|
||||
<div *ngIf="src === null" class="thumbnail-content outer">
|
||||
<div class="inner">
|
||||
<div class="thumbnail-placeholder w-100 h-100 p-3">{{ placeholder | translate }}</div>
|
||||
<div class="thumbnail-placeholder w-100 h-100 p-3 lead">{{ placeholder | translate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,4 +1,4 @@
|
||||
.thumbnail {
|
||||
.limit-width {
|
||||
max-width: var(--ds-thumbnail-max-width);
|
||||
}
|
||||
|
||||
|
@@ -5,7 +5,7 @@ import { hasValue } from '../shared/empty.util';
|
||||
/**
|
||||
* This component renders a given Bitstream as a thumbnail.
|
||||
* One input parameter of type Bitstream is expected.
|
||||
* If no Bitstream is provided, a holderjs image will be rendered instead.
|
||||
* If no Bitstream is provided, a HTML placeholder will be rendered instead.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'ds-thumbnail',
|
||||
@@ -39,6 +39,11 @@ export class ThumbnailComponent implements OnInit {
|
||||
*/
|
||||
@Input() placeholder? = 'thumbnail.default.placeholder';
|
||||
|
||||
/**
|
||||
* Limit thumbnail width to --ds-thumbnail-max-width
|
||||
*/
|
||||
@Input() limitWidth? = true;
|
||||
|
||||
/**
|
||||
* Initialize the thumbnail.
|
||||
* Use a default image if no actual image is available.
|
||||
|
Reference in New Issue
Block a user