Skip to content

Commit 038b425

Browse files
authored
Merge pull request #1769 from jamesmisson/4.4.0-rc3-bug-fix
4.4.0 rc3 bug fix
2 parents dcc44f6 + 46c319c commit 038b425

3 files changed

Lines changed: 12 additions & 19 deletions

File tree

src/content-handlers/iiif/extensions/uv-openseadragon-extension/ChoiceSwitchDialogue.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ export class ChoiceSwitchDialogue extends BaseChoiceSwitchDialogue {
8686
});
8787

8888
const mobileFooterButton = extension.mobileFooterPanel?.$choiceSwitchButton;
89+
8990
this.$anchor =
9091
mobileFooterButton?.is(":visible") && mobileFooterButton?.length
9192
? mobileFooterButton

src/content-handlers/iiif/extensions/uv-openseadragon-extension/Extension.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -620,16 +620,14 @@ export default class OpenSeadragonExtension extends BaseExtension<Config> {
620620
this.footerPanel.init();
621621
}
622622

623-
if (this.helper.hasChoices()) {
624-
this.$choiceSwitchDialogue = $(
625-
'<div class="overlay choiceSwitch" aria-hidden="true"></div>'
626-
);
627-
this.shell.$overlays.append(this.$choiceSwitchDialogue);
628-
this.choiceSwitchDialogue = new ChoiceSwitchDialogue(
629-
this.$choiceSwitchDialogue,
630-
this.shell
631-
);
632-
}
623+
this.$choiceSwitchDialogue = $(
624+
'<div class="overlay choiceSwitch" aria-hidden="true"></div>'
625+
);
626+
this.shell.$overlays.append(this.$choiceSwitchDialogue);
627+
this.choiceSwitchDialogue = new ChoiceSwitchDialogue(
628+
this.$choiceSwitchDialogue,
629+
this.shell
630+
);
633631
}
634632

635633
render(): void {

src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,8 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
636636
this.hidePrevButton();
637637
this.hideNextButton();
638638

639+
this.createChoiceSwitch();
640+
639641
this.isCreated = true;
640642
//this.resize();
641643

@@ -659,8 +661,6 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
659661
{ capture: true }
660662
);
661663

662-
this.createChoiceSwitch();
663-
664664
this.extensionHost.subscribe(IIIFEvents.CLOSE_ACTIVE_DIALOGUE, () => {
665665
this.$viewer.removeClass("dialogue-open");
666666
});
@@ -773,15 +773,9 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
773773
}
774774

775775
createChoiceSwitch(): void {
776-
// check for a choice on either of the displayed canvases if in 2-up view
777-
const indices = this.extension.getPagedIndices();
778-
const hasChoices = this.indicesIncludeChoices(indices);
779-
780-
if (!hasChoices) return;
781-
782776
this.$choiceSwitchButton = this.$rotateButton.clone();
783-
this.$choiceSwitchButton.attr("title", this.content.layers);
784777
this.$choiceSwitchButton.attr("aria-label", this.content.layers);
778+
this.$choiceSwitchButton.attr("title", this.content.layers);
785779
this.$choiceSwitchButton.switchClass("rotate", "choiceSwitch");
786780
this.$choiceSwitchButton.attr("tabindex", 0);
787781

0 commit comments

Comments
 (0)