diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/ChoiceSwitchDialogue.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/ChoiceSwitchDialogue.ts index a01119788..329d8823a 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/ChoiceSwitchDialogue.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/ChoiceSwitchDialogue.ts @@ -86,6 +86,7 @@ export class ChoiceSwitchDialogue extends BaseChoiceSwitchDialogue { }); const mobileFooterButton = extension.mobileFooterPanel?.$choiceSwitchButton; + this.$anchor = mobileFooterButton?.is(":visible") && mobileFooterButton?.length ? mobileFooterButton diff --git a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts index bed219f7e..a0baa31ee 100644 --- a/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts +++ b/src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts @@ -620,16 +620,14 @@ export default class OpenSeadragonExtension extends BaseExtension { this.footerPanel.init(); } - if (this.helper.hasChoices()) { - this.$choiceSwitchDialogue = $( - '' - ); - this.shell.$overlays.append(this.$choiceSwitchDialogue); - this.choiceSwitchDialogue = new ChoiceSwitchDialogue( - this.$choiceSwitchDialogue, - this.shell - ); - } + this.$choiceSwitchDialogue = $( + '' + ); + this.shell.$overlays.append(this.$choiceSwitchDialogue); + this.choiceSwitchDialogue = new ChoiceSwitchDialogue( + this.$choiceSwitchDialogue, + this.shell + ); } render(): void { diff --git a/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts b/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts index 9c69191e4..bcf0ae0ba 100644 --- a/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts +++ b/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts @@ -636,6 +636,8 @@ export class OpenSeadragonCenterPanel extends CenterPanel< this.hidePrevButton(); this.hideNextButton(); + this.createChoiceSwitch(); + this.isCreated = true; //this.resize(); @@ -659,8 +661,6 @@ export class OpenSeadragonCenterPanel extends CenterPanel< { capture: true } ); - this.createChoiceSwitch(); - this.extensionHost.subscribe(IIIFEvents.CLOSE_ACTIVE_DIALOGUE, () => { this.$viewer.removeClass("dialogue-open"); }); @@ -773,15 +773,9 @@ export class OpenSeadragonCenterPanel extends CenterPanel< } createChoiceSwitch(): void { - // check for a choice on either of the displayed canvases if in 2-up view - const indices = this.extension.getPagedIndices(); - const hasChoices = this.indicesIncludeChoices(indices); - - if (!hasChoices) return; - this.$choiceSwitchButton = this.$rotateButton.clone(); - this.$choiceSwitchButton.attr("title", this.content.layers); this.$choiceSwitchButton.attr("aria-label", this.content.layers); + this.$choiceSwitchButton.attr("title", this.content.layers); this.$choiceSwitchButton.switchClass("rotate", "choiceSwitch"); this.$choiceSwitchButton.attr("tabindex", 0);