diff --git a/src/app/workspace/comparison/comparison.component.html b/src/app/workspace/comparison/comparison.component.html index 3084fcbd9d..cc09432bdc 100644 --- a/src/app/workspace/comparison/comparison.component.html +++ b/src/app/workspace/comparison/comparison.component.html @@ -3,16 +3,16 @@ - + - + - + - + diff --git a/src/app/workspace/comparison/comparison.component.ts b/src/app/workspace/comparison/comparison.component.ts index f59b55bb77..37a595ce89 100644 --- a/src/app/workspace/comparison/comparison.component.ts +++ b/src/app/workspace/comparison/comparison.component.ts @@ -1,5 +1,6 @@ import { Component, Input, OnChanges } from '@angular/core'; import { ShortResInfo } from '../results/list-view/list-view.component'; +import { SplitSize } from '../results/results.component'; @Component({ selector: 'app-comparison', @@ -23,6 +24,10 @@ export class ComparisonComponent implements OnChanges { */ @Input() resources?: ShortResInfo[]; + + // parent (or own) split size changed + @Input() splitSizeChanged: SplitSize; + // if number of selected resources > 3, divide them into 2 rows topRow: string[] = []; bottomRow: string[] = []; diff --git a/src/app/workspace/resource/representation/av-timeline/av-timeline.component.ts b/src/app/workspace/resource/representation/av-timeline/av-timeline.component.ts index f7f0299289..da44fb269f 100644 --- a/src/app/workspace/resource/representation/av-timeline/av-timeline.component.ts +++ b/src/app/workspace/resource/representation/av-timeline/av-timeline.component.ts @@ -10,6 +10,7 @@ import { SimpleChange, ViewChild } from '@angular/core'; +import { SplitSize } from 'src/app/workspace/results/results.component'; export interface PointerValue { position: number; @@ -40,6 +41,9 @@ export class AvTimelineComponent implements OnChanges { // disable in case of missing file @Input() disabled: boolean; + // split size changed + @Input() splitSizeChanged: SplitSize; + // send click position to parent @Output() changed = new EventEmitter(); @@ -88,6 +92,11 @@ export class AvTimelineComponent implements OnChanges { return; } + if (changes.splitSizeChanged) { + // reset the timeline dimension + this.timelineDimension = this._getResizedTimelineDimensions(); + } + if (!this.timelineDimension) { // calculate timeline dimension if it doesn't exist this.timelineDimension = this._getTimelineDimensions(); @@ -206,6 +215,7 @@ export class AvTimelineComponent implements OnChanges { */ private _onWindowResize(ev: Event) { this.timelineDimension = this._getResizedTimelineDimensions(); + this.updatePositionFromTime(this.value); this.dimension.emit(this.timelineDimension); } diff --git a/src/app/workspace/resource/representation/video/video.component.html b/src/app/workspace/resource/representation/video/video.component.html index 29e3ffd577..f7090b71be 100644 --- a/src/app/workspace/resource/representation/video/video.component.html +++ b/src/app/workspace/resource/representation/video/video.component.html @@ -30,7 +30,7 @@ - diff --git a/src/app/workspace/resource/representation/video/video.component.ts b/src/app/workspace/resource/representation/video/video.component.ts index 01ab8247ef..83d148dae0 100644 --- a/src/app/workspace/resource/representation/video/video.component.ts +++ b/src/app/workspace/resource/representation/video/video.component.ts @@ -16,6 +16,7 @@ import { mergeMap } from 'rxjs/operators'; import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens'; import { DialogComponent } from 'src/app/main/dialog/dialog.component'; import { ErrorHandlerService } from 'src/app/main/services/error-handler.service'; +import { SplitSize } from 'src/app/workspace/results/results.component'; import { EmitEvent, Events, UpdatedFileEventValue, ValueOperationEventService } from '../../services/value-operation-event.service'; import { PointerValue } from '../av-timeline/av-timeline.component'; import { FileRepresentation } from '../file-representation'; @@ -34,6 +35,8 @@ export class VideoComponent implements OnInit, AfterViewInit { @Input() parentResource: ReadResource; + @Input() splitSizeChanged: SplitSize; + @Output() loaded = new EventEmitter(); @ViewChild('videoEle') videoEle: ElementRef; diff --git a/src/app/workspace/resource/resource.component.html b/src/app/workspace/resource/resource.component.html index 36966b90e2..e73266d51c 100644 --- a/src/app/workspace/resource/resource.component.html +++ b/src/app/workspace/resource/resource.component.html @@ -35,6 +35,7 @@ diff --git a/src/app/workspace/resource/resource.component.ts b/src/app/workspace/resource/resource.component.ts index 0eba267da9..615f75279b 100644 --- a/src/app/workspace/resource/resource.component.ts +++ b/src/app/workspace/resource/resource.component.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/member-ordering */ -import { Component, Inject, Input, OnChanges, OnDestroy, OnInit, ViewChild } from '@angular/core'; +import { Component, Inject, Input, OnChanges, OnDestroy, OnInit, SimpleChange, ViewChild } from '@angular/core'; import { MatTabChangeEvent } from '@angular/material/tabs'; import { Title } from '@angular/platform-browser'; import { @@ -29,6 +29,7 @@ import { DspApiConnectionToken } from 'src/app/main/declarations/dsp-api-tokens' import { ErrorHandlerService } from 'src/app/main/services/error-handler.service'; import { NotificationService } from 'src/app/main/services/notification.service'; import { Session, SessionService } from 'src/app/main/services/session.service'; +import { SplitSize } from '../results/results.component'; import { DspCompoundPosition, DspResource } from './dsp-resource'; import { PropertyInfoValues } from './properties/properties.component'; import { FileRepresentation, RepresentationConstants } from './representation/file-representation'; @@ -49,6 +50,8 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy { @Input() resourceIri: string; + @Input() splitSizeChanged: SplitSize; + projectCode: string; resourceUuid: string; @@ -157,7 +160,12 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy { } - ngOnChanges() { + ngOnChanges(changes: { [propName: string]: SimpleChange }) { + // do not reload the whole resource when the split size has changed + if (this.splitSizeChanged) { + return; + } + this.loading = true; // reset all resources this.resource = undefined; diff --git a/src/app/workspace/results/results.component.html b/src/app/workspace/results/results.component.html index 4ab5625eb2..56a96638c9 100644 --- a/src/app/workspace/results/results.component.html +++ b/src/app/workspace/results/results.component.html @@ -1,7 +1,7 @@
- + @@ -10,14 +10,14 @@
- + + [resources]="selectedResources.resInfo" [splitSizeChanged]="splitSizeChanged">
diff --git a/src/app/workspace/results/results.component.ts b/src/app/workspace/results/results.component.ts index 3606466c08..fccfc0bbc6 100644 --- a/src/app/workspace/results/results.component.ts +++ b/src/app/workspace/results/results.component.ts @@ -3,6 +3,11 @@ import { Title } from '@angular/platform-browser'; import { ActivatedRoute, Params } from '@angular/router'; import { FilteredResources, SearchParams } from './list-view/list-view.component'; +export interface SplitSize { + gutterNum: number; + sizes: Array; +}; + @Component({ selector: 'app-results', templateUrl: './results.component.html', @@ -28,6 +33,8 @@ export class ResultsComponent { loading = true; + splitSizeChanged: SplitSize; + constructor( private _route: ActivatedRoute, private _titleService: Title