1
0
mirror of https://github.com/bpatrik/pigallery2.git synced 2024-11-24 08:42:24 +02:00

improving media merging and map icon rendering

This commit is contained in:
Patrik J. Braun 2018-12-09 13:59:51 +01:00
parent 3ef2746bc2
commit aa6f4b83ae
6 changed files with 17 additions and 3 deletions

View File

@ -90,7 +90,7 @@ export class PublicConfigClass {
Thumbnail: {
concurrentThumbnailGenerations: 1,
thumbnailSizes: [200, 400, 600],
iconSize: 30
iconSize: 45
},
Search: {
enabled: true,

View File

@ -143,6 +143,9 @@ export class GalleryComponent implements OnInit, OnDestroy {
};
private sortDirectories() {
if (!this.directories) {
return;
}
switch (this._galleryService.sorting.value) {
case SortingMethods.ascName:
case SortingMethods.ascDate:

View File

@ -47,6 +47,7 @@ export class GalleryService {
this.sorting.next(sorting);
}
public async loadDirectory(directoryName: string): Promise<void> {
const content = new ContentWrapper();

View File

@ -253,7 +253,8 @@ export class GalleryGridComponent implements OnChanges, OnInit, AfterViewInit, O
// merge new data with old one
let lastSameIndex = 0;
let lastRowId = null;
for (let i = 0; i < this.media.length && i < this.photosToRender.length; ++i) {
let i = 0;
for (; i < this.media.length && i < this.photosToRender.length; ++i) {
// If a media changed the whole row has to be removed
if (this.photosToRender[i].rowId !== lastRowId) {
@ -264,12 +265,20 @@ export class GalleryGridComponent implements OnChanges, OnInit, AfterViewInit, O
break;
}
}
// if all the same
if (this.photosToRender.length > 0 &&
i === this.photosToRender.length &&
i === this.media.length &&
this.photosToRender[i - 1].equals(this.media[i - 1])) {
lastSameIndex = i;
}
if (lastSameIndex > 0) {
this.photosToRender.splice(lastSameIndex, this.photosToRender.length - lastSameIndex);
this.renderedPhotoIndex = lastSameIndex;
} else {
this.clearRenderedPhotos();
}
}

View File

@ -25,7 +25,7 @@
<yaga-icon
*ngIf="photo.iconUrl"
[iconUrl]="photo.iconUrl"
[iconSize]="iconSize"
[iconSize]="yagaMap.zoom < 15 ? smallIconSize : iconSize"
></yaga-icon>
<yaga-popup
(open)="loadPreview(photo)"

View File

@ -37,6 +37,7 @@ export class GalleryMapLightboxComponent implements OnChanges, AfterViewInit {
@ViewChild('root') elementRef: ElementRef;
@ViewChild('yagaMap') yagaMap: MapComponent;
public smallIconSize = new Point(Config.Client.Thumbnail.iconSize * 0.75, Config.Client.Thumbnail.iconSize * 0.75);
public iconSize = new Point(Config.Client.Thumbnail.iconSize, Config.Client.Thumbnail.iconSize);
constructor(public fullScreenService: FullScreenService,