mirror of
https://github.com/xuthus83/pigallery2.git
synced 2025-01-14 14:43:17 +08:00
playback is paused on dropdown open and resumed on dropdown close to prevent autoclose when next image is loaded
This commit is contained in:
parent
75c26f8422
commit
243495147f
@ -198,6 +198,7 @@
|
||||
title="auto play"></span>
|
||||
<span class="oi btn-group highlight control-button"
|
||||
dropdown
|
||||
(isOpenChange)="$event ? pause() : play()"
|
||||
[dropup]="true">
|
||||
<div id="button-duration"
|
||||
dropdownToggle
|
||||
@ -213,7 +214,7 @@
|
||||
aria-labelledby="button-duration">
|
||||
<li *ngFor="let duration of playBackDurations"
|
||||
role="menuitem"
|
||||
(click)="play(duration)">
|
||||
(click)="setPlayBackDuration(duration)">
|
||||
<a class="dropdown-item"
|
||||
[class]="selectedPlayBackDuration === duration ? 'active' : ''">
|
||||
{{duration}}s
|
||||
|
@ -301,11 +301,8 @@ export class ControlsLightboxComponent implements OnDestroy, OnInit, OnChanges {
|
||||
this.nextPhoto.emit();
|
||||
};
|
||||
|
||||
public play(duration?: number): void {
|
||||
public play(): void {
|
||||
this.pause();
|
||||
if (duration) {
|
||||
this.setPlayBackDuration(duration);
|
||||
}
|
||||
this.timerSub = this.timer
|
||||
.pipe(filter((t) => t % this.selectedPlayBackDuration === 0))
|
||||
.subscribe(this.showNextMedia);
|
||||
|
Loading…
x
Reference in New Issue
Block a user