mirror of
https://github.com/bpatrik/pigallery2.git
synced 2024-12-25 02:04:15 +02:00
improving media merging and map icon rendering
This commit is contained in:
parent
3ef2746bc2
commit
aa6f4b83ae
@ -90,7 +90,7 @@ export class PublicConfigClass {
|
||||
Thumbnail: {
|
||||
concurrentThumbnailGenerations: 1,
|
||||
thumbnailSizes: [200, 400, 600],
|
||||
iconSize: 30
|
||||
iconSize: 45
|
||||
},
|
||||
Search: {
|
||||
enabled: true,
|
||||
|
@ -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:
|
||||
|
@ -47,6 +47,7 @@ export class GalleryService {
|
||||
this.sorting.next(sorting);
|
||||
}
|
||||
|
||||
|
||||
public async loadDirectory(directoryName: string): Promise<void> {
|
||||
const content = new ContentWrapper();
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -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)"
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user