diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2024-07-07 17:11:24 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2024-07-07 17:11:24 +0200 |
commit | a5c59d22bf01c963fadfcc80d9232d330044bdde (patch) | |
tree | 9dd23e30f95a13a1e7f4e03edc2e3fa9678e75f0 | |
parent | SlideShow: add missing hook removal (diff) | |
download | online-a5c59d22bf01c963fadfcc80d9232d330044bdde.tar.gz online-a5c59d22bf01c963fadfcc80d9232d330044bdde.zip |
SlideShow: do transition only when we have slide content
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I131acee71fade034759097048116cadf76d4a319
-rw-r--r-- | browser/src/slideshow/SlideShowPresenter.ts | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/browser/src/slideshow/SlideShowPresenter.ts b/browser/src/slideshow/SlideShowPresenter.ts index d6c2c26039..89cd4085b4 100644 --- a/browser/src/slideshow/SlideShowPresenter.ts +++ b/browser/src/slideshow/SlideShowPresenter.ts @@ -78,8 +78,10 @@ class SlideShowPresenter { } _onCanvasClick() { - if (this._currentSlide + 1 >= this._getSlidesCount()) + if (this._currentSlide + 1 >= this._getSlidesCount()) { this._stopFullScreen(); + return; + } const slide = this._fetchSlide(this._currentSlide); if (!slide) { @@ -157,15 +159,10 @@ class SlideShowPresenter { _doPresentation() { const previousSlide = new Image(); - - if (this._currentSlide === 0) { - // TODO: use black background as an initial slide - previousSlide.src = this._fetchSlide(0); - } else { - previousSlide.src = this._fetchSlide(this._currentSlide); - } - - this._doTransition(previousSlide, this._currentSlide); + previousSlide.src = this._fetchSlide(this._currentSlide); + previousSlide.onload = () => { + this._doTransition(previousSlide, this._currentSlide); + }; } _doFallbackPresentation = () => { |