mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
#885 move size to css
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
.ngx-gallery {
|
||||
display: inline-block;
|
||||
margin-bottom: 20px;
|
||||
width: 340px !important;
|
||||
height: 279px !important;
|
||||
}
|
||||
|
@@ -17,8 +17,6 @@ export class MediaViewerImageComponent implements OnInit {
|
||||
@Input() images: MediaViewerItem[];
|
||||
@Input() preview?: boolean;
|
||||
@Input() image?: string;
|
||||
@Input() width: string;
|
||||
@Input() height: string;
|
||||
|
||||
loggedin: boolean;
|
||||
|
||||
@@ -44,8 +42,6 @@ export class MediaViewerImageComponent implements OnInit {
|
||||
imageSize: 'contain',
|
||||
thumbnails: false,
|
||||
imageArrows: false,
|
||||
width: this.width,
|
||||
height: this.height,
|
||||
startIndex: 0,
|
||||
imageAnimation: NgxGalleryAnimation.Slide,
|
||||
previewCloseOnEsc: true,
|
||||
@@ -54,7 +50,6 @@ export class MediaViewerImageComponent implements OnInit {
|
||||
previewFullscreen: true,
|
||||
},
|
||||
];
|
||||
console.log(this.galleryOptions)
|
||||
|
||||
if (this.image) {
|
||||
this.galleryImages = [
|
||||
|
@@ -1,6 +1,5 @@
|
||||
<video
|
||||
#media
|
||||
[ngStyle]="{'width': width, 'height': height}"
|
||||
[src]="filteredMedias[currentIndex].bitstream._links.content.href"
|
||||
id="singleVideo"
|
||||
[poster]="
|
||||
|
@@ -1 +1,4 @@
|
||||
|
||||
video {
|
||||
width: 340px;
|
||||
height: 279px;
|
||||
}
|
||||
|
@@ -11,8 +11,6 @@ import { MediaViewerItem } from '../../../core/shared/media-viewer-item.model';
|
||||
})
|
||||
export class MediaViewerVideoComponent implements OnInit {
|
||||
@Input() medias: MediaViewerItem[];
|
||||
@Input() width: string;
|
||||
@Input() height: string;
|
||||
|
||||
filteredMedias: MediaViewerItem[];
|
||||
|
||||
|
@@ -1,28 +1,36 @@
|
||||
<ng-container *ngVar="mediaList$ | async as mediaList">
|
||||
<ds-loading *ngIf="isLoading" message="{{ 'loading.default' | translate }}" [showMessage]="false"></ds-loading>
|
||||
<ds-loading
|
||||
*ngIf="isLoading"
|
||||
message="{{ 'loading.default' | translate }}"
|
||||
[showMessage]="false"
|
||||
></ds-loading>
|
||||
<div class="media-viewer" *ngIf="!isLoading">
|
||||
<ng-container *ngIf="mediaList.length > 0">
|
||||
<ng-container *ngIf="config.video">
|
||||
<ng-container *ngIf="
|
||||
<ng-container *ngIf="videoOptions">
|
||||
<ng-container
|
||||
*ngIf="
|
||||
mediaList[0]?.format === 'video' || mediaList[0]?.format === 'audio'
|
||||
">
|
||||
<ds-media-viewer-video [medias]="mediaList" [width]="config.width" [height]="config.height">
|
||||
</ds-media-viewer-video>
|
||||
"
|
||||
>
|
||||
<ds-media-viewer-video [medias]="mediaList"></ds-media-viewer-video>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaList[0]?.format === 'image'">
|
||||
<ds-media-viewer-image [images]="mediaList" [width]="config.width" [height]="config.height">
|
||||
</ds-media-viewer-image>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaList[0]?.format === 'image'">
|
||||
<ds-media-viewer-image [images]="mediaList"></ds-media-viewer-image>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="
|
||||
<ng-container
|
||||
*ngIf="
|
||||
((mediaList[0]?.format !== 'image') &&
|
||||
(!config.video || mediaList[0]?.format !== 'video') &&
|
||||
(!config.video || mediaList[0]?.format !== 'audio')) ||
|
||||
(!videoOptions || mediaList[0]?.format !== 'video') &&
|
||||
(!videoOptions || mediaList[0]?.format !== 'audio')) ||
|
||||
mediaList.length === 0
|
||||
">
|
||||
<ds-media-viewer-image [image]="mediaList[0]?.thumbnail || thumbnailPlaceholder" [preview]="false"
|
||||
[width]="config.width" [height]="config.height"></ds-media-viewer-image>
|
||||
"
|
||||
>
|
||||
<ds-media-viewer-image
|
||||
[image]="mediaList[0]?.thumbnail || thumbnailPlaceholder"
|
||||
[preview]="false"
|
||||
></ds-media-viewer-image>
|
||||
</ng-container>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
@@ -1,7 +1,6 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { BehaviorSubject, Observable } from 'rxjs';
|
||||
import { filter, take } from 'rxjs/operators';
|
||||
import { MediaViewerConfig } from '../../../config/media-viewer-config.interface';
|
||||
import { BitstreamDataService } from '../../core/data/bitstream-data.service';
|
||||
import { PaginatedList } from '../../core/data/paginated-list.model';
|
||||
import { RemoteData } from '../../core/data/remote-data';
|
||||
@@ -24,7 +23,7 @@ import { followLink } from '../../shared/utils/follow-link-config.model';
|
||||
})
|
||||
export class MediaViewerComponent implements OnInit {
|
||||
@Input() item: Item;
|
||||
@Input() config: MediaViewerConfig;
|
||||
@Input() videoOptions: boolean;
|
||||
|
||||
mediaList$: BehaviorSubject<MediaViewerItem[]>;
|
||||
|
||||
@@ -38,7 +37,6 @@ export class MediaViewerComponent implements OnInit {
|
||||
* This metod loads all the Bitstreams and Thumbnails and contert it to media item
|
||||
*/
|
||||
ngOnInit(): void {
|
||||
console.log(this.config)
|
||||
this.mediaList$ = new BehaviorSubject([]);
|
||||
this.isLoading = true;
|
||||
this.loadRemoteData('ORIGINAL').subscribe((bitstreamsRD) => {
|
||||
|
@@ -14,7 +14,7 @@
|
||||
</ds-metadata-field-wrapper>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaViewer.image">
|
||||
<ds-media-viewer [item]="object" [config]="mediaViewer"></ds-media-viewer>
|
||||
<ds-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-media-viewer>
|
||||
</ng-container>
|
||||
<ds-item-page-file-section [item]="object"></ds-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
|
@@ -14,7 +14,7 @@
|
||||
</ds-metadata-field-wrapper>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="mediaViewer.image">
|
||||
<ds-media-viewer [item]="object" [config]="mediaViewer"></ds-media-viewer>
|
||||
<ds-media-viewer [item]="object" [videoOptions]="mediaViewer.video"></ds-media-viewer>
|
||||
</ng-container>
|
||||
<ds-item-page-file-section [item]="object"></ds-item-page-file-section>
|
||||
<ds-item-page-date-field [item]="object"></ds-item-page-date-field>
|
||||
|
@@ -3,6 +3,4 @@ import { Config } from './config.interface';
|
||||
export interface MediaViewerConfig extends Config {
|
||||
image: boolean;
|
||||
video: boolean;
|
||||
width: string;
|
||||
height: string;
|
||||
}
|
||||
|
@@ -232,7 +232,5 @@ export const environment: GlobalConfig = {
|
||||
mediaViewer: {
|
||||
image: false,
|
||||
video: false,
|
||||
width: '340px',
|
||||
height: '279px',
|
||||
},
|
||||
};
|
||||
|
Reference in New Issue
Block a user