From 83e709f57580e42a6370829287b786d58ef49268 Mon Sep 17 00:00:00 2001 From: John Factotum <50942278+johnfactotum@users.noreply.github.com> Date: Sat, 9 Sep 2023 15:53:29 +0800 Subject: [PATCH] FXL: fix page turning around blank pages --- fixed-layout.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/fixed-layout.js b/fixed-layout.js index b14ab1d..48b7977 100644 --- a/fixed-layout.js +++ b/fixed-layout.js @@ -148,13 +148,13 @@ export class FixedLayout extends HTMLElement { } else { this.#left = await this.#createFrame(left) this.#right = await this.#createFrame(right) - this.#side = side + this.#side = this.#left.blank ? 'right' + : this.#right.blank ? 'left' : side this.#render() } } #goLeft() { - if (this.#center) return - if (this.#left?.blank) return true + if (this.#center || this.#left?.blank) return if (this.#portrait && this.#left?.element?.style?.display === 'none') { this.#right.element.style.display = 'none' this.#left.element.style.display = 'block' @@ -163,8 +163,7 @@ export class FixedLayout extends HTMLElement { } } #goRight() { - if (this.#center) return - if (this.#right?.blank) return true + if (this.#center || this.#right?.blank) return if (this.#portrait && this.#right?.element?.style?.display === 'none') { this.#left.element.style.display = 'none' this.#right.element.style.display = 'block'