From f91e723d31497874a060cbb1ae6b08c8486c4bef Mon Sep 17 00:00:00 2001 From: LlGC-jop Date: Tue, 22 Oct 2024 14:10:15 +0100 Subject: [PATCH] Adds a11y click to OSD buttons --- .../OpenSeadragonCenterPanel.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) 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 c7a904ab0..fb4cb9840 100644 --- a/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts +++ b/src/content-handlers/iiif/modules/uv-openseadragoncenterpanel-module/OpenSeadragonCenterPanel.ts @@ -367,7 +367,7 @@ export class OpenSeadragonCenterPanel extends CenterPanel< this.$zoomInButton.addClass("zoomIn viewportNavButton"); this.onAccessibleClick(this.$zoomInButton, () => { - console.log(this.viewer); + this.zoomIn(); }, false, true); this.$zoomOutButton = this.$viewer.find('div[title="Zoom out"]'); @@ -376,18 +376,30 @@ export class OpenSeadragonCenterPanel extends CenterPanel< this.$zoomOutButton.prop("aria-label", this.content.zoomOut); this.$zoomOutButton.addClass("zoomOut viewportNavButton"); + this.onAccessibleClick(this.$zoomOutButton, () => { + this.zoomOut(); + }, false, true); + this.$goHomeButton = this.$viewer.find('div[title="Go home"]'); this.$goHomeButton.attr("tabindex", 0); this.$goHomeButton.prop("title", this.content.goHome); this.$goHomeButton.prop("aria-label", this.content.goHome); this.$goHomeButton.addClass("goHome viewportNavButton"); + this.onAccessibleClick(this.$goHomeButton, () => { + this.goHome(); + }, false, true); + this.$rotateButton = this.$viewer.find('div[title="Rotate right"]'); this.$rotateButton.attr("tabindex", 0); this.$rotateButton.prop("title", this.content.rotateRight); this.$rotateButton.prop("aria-label", this.content.rotateRight); this.$rotateButton.addClass("rotate viewportNavButton"); + this.onAccessibleClick(this.$rotateButton, () => { + this.rotateRight(); + }, false, true); + if (this.showAdjustImageButton) { this.$adjustImageButton = this.$rotateButton.clone(); this.$adjustImageButton.prop('title', this.content.adjustImage); @@ -396,6 +408,10 @@ export class OpenSeadragonCenterPanel extends CenterPanel< this.extensionHost.publish(IIIFEvents.SHOW_ADJUSTIMAGE_DIALOGUE); }); this.$adjustImageButton.insertAfter(this.$rotateButton); + + this.onAccessibleClick(this.$adjustImageButton, () => { + this.extensionHost.publish(IIIFEvents.SHOW_ADJUSTIMAGE_DIALOGUE); + }, false, true); } this.$viewportNavButtonsContainer = this.$viewer.find(