Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ export class ChoiceSwitchDialogue extends BaseChoiceSwitchDialogue {
});

const mobileFooterButton = extension.mobileFooterPanel?.$choiceSwitchButton;

this.$anchor =
mobileFooterButton?.is(":visible") && mobileFooterButton?.length
? mobileFooterButton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,16 +620,14 @@ export default class OpenSeadragonExtension extends BaseExtension<Config> {
this.footerPanel.init();
}

if (this.helper.hasChoices()) {
this.$choiceSwitchDialogue = $(
'<div class="overlay choiceSwitch" aria-hidden="true"></div>'
);
this.shell.$overlays.append(this.$choiceSwitchDialogue);
this.choiceSwitchDialogue = new ChoiceSwitchDialogue(
this.$choiceSwitchDialogue,
this.shell
);
}
this.$choiceSwitchDialogue = $(
'<div class="overlay choiceSwitch" aria-hidden="true"></div>'
);
this.shell.$overlays.append(this.$choiceSwitchDialogue);
this.choiceSwitchDialogue = new ChoiceSwitchDialogue(
this.$choiceSwitchDialogue,
this.shell
);
}

render(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,8 @@ export class OpenSeadragonCenterPanel extends CenterPanel<
this.hidePrevButton();
this.hideNextButton();

this.createChoiceSwitch();

this.isCreated = true;
//this.resize();

Expand All @@ -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");
});
Expand Down Expand Up @@ -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);

Expand Down