mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
Fix grid image merging
This commit is contained in:
parent
040e8f1ff2
commit
6de2aeed57
@ -26,7 +26,7 @@ import {ContentService} from '../content.service';
|
|||||||
import {MediaDTO, MediaDTOUtils,} from '../../../../../common/entities/MediaDTO';
|
import {MediaDTO, MediaDTOUtils,} from '../../../../../common/entities/MediaDTO';
|
||||||
import {QueryParams} from '../../../../../common/QueryParams';
|
import {QueryParams} from '../../../../../common/QueryParams';
|
||||||
import {GallerySortingService, MediaGroup} from '../navigator/sorting.service';
|
import {GallerySortingService, MediaGroup} from '../navigator/sorting.service';
|
||||||
import { GroupByTypes } from '../../../../../common/entities/SortingMethods';
|
import {GroupByTypes} from '../../../../../common/entities/SortingMethods';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-gallery-grid',
|
selector: 'app-gallery-grid',
|
||||||
@ -181,6 +181,12 @@ export class GalleryGridComponent
|
|||||||
let lastRowId = 0;
|
let lastRowId = 0;
|
||||||
let diffFound = false;
|
let diffFound = false;
|
||||||
for (let i = 0; i < this.mediaGroups.length && i < this.mediaToRender.length; ++i) {
|
for (let i = 0; i < this.mediaGroups.length && i < this.mediaToRender.length; ++i) {
|
||||||
|
if (diffFound) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.mediaToRender[i].name = this.mediaGroups[i].name; // update name if only this changed
|
||||||
|
|
||||||
for (let j = 0; j < this.mediaGroups[i].media.length && j < this.mediaToRender[i].media.length; ++j) {
|
for (let j = 0; j < this.mediaGroups[i].media.length && j < this.mediaToRender[i].media.length; ++j) {
|
||||||
const media = this.mediaGroups[i].media[j];
|
const media = this.mediaGroups[i].media[j];
|
||||||
const gridMedia = this.mediaToRender[i].media[j];
|
const gridMedia = this.mediaToRender[i].media[j];
|
||||||
@ -210,7 +216,7 @@ export class GalleryGridComponent
|
|||||||
}
|
}
|
||||||
// if all the same
|
// if all the same
|
||||||
if (diffFound) {
|
if (diffFound) {
|
||||||
if (lastSameIndex.media == 0 && lastSameIndex.groups == 0) {
|
if (lastSameIndex.media == 0 && lastSameIndex.groups <= 0) {
|
||||||
this.clearRenderedPhotos();
|
this.clearRenderedPhotos();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user