Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions plugins/archive/app/archive.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,20 @@ minds-archive-theatre{
left: 0;
bottom: 0;
right: 0;

.minds-img-landscape{
img{
width: 100%;
height: auto;
}
}
.minds-img-portrait{
img{
height: 100%;
width: auto;
}
}
img{
max-width:100%;
height:100%;
object-fit: contain;
}
minds-video{
background:#000;
Expand Down
11 changes: 10 additions & 1 deletion plugins/archive/app/view/views/theatre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { Material } from '../../../../directives/material';
[hidden]="object.container_guid == object.owner_guid || !object.album_children_guids || object.album_children_guids.length <= 1">
keyboard_arrow_left
</i>
<div class="minds-archive-stage" *ngIf="object.subtype == 'image'">
<div class="minds-archive-stage" [ngClass]="{minds-image-landscape: orientation == 'landscape', minds-image-portrait: orientation == 'portrait'}" *ngIf="object.subtype == 'image'">
<img src="/archive/thumbnail/{{object.guid}}/xlarge"/>
</div>
<div class="minds-archive-stage" *ngIf="object.subtype == 'video'">
Expand All @@ -44,6 +44,7 @@ import { Material } from '../../../../directives/material';
export class ArchiveTheatre {

object: any = {};
orientation: string;
session = SessionFactory.build();

constructor(public client: Client, public router: Router){
Expand All @@ -53,6 +54,14 @@ export class ArchiveTheatre {
if(!value.guid)
return;
this.object = value;
if(this.object.subtype == 'image'){
/*Check image's aspect ratio for landscape or l*/
if(this.object.naturalWidth >= this.object.naturalHeight){
this.orientation = 'landscape';
} else {
this.orientation = 'portrait';
}
}
}

prev(){
Expand Down