From 3b1b2d6d23454de0668ed2dd74c9c5eb8459e6bf Mon Sep 17 00:00:00 2001 From: Aiosa <469130@mail.muni.cz> Date: Thu, 7 Nov 2024 12:01:02 +0100 Subject: [PATCH] Fix: reference the correct drawer in invalidation routine. --- src/world.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/world.js b/src/world.js index bfa4901a..a31641f5 100644 --- a/src/world.js +++ b/src/world.js @@ -300,11 +300,12 @@ $.extend( $.World.prototype, $.EventSource.prototype, /** @lends OpenSeadragon.W return $.Promise.resolve(); } - // this.viewer.viewer is defined in navigator, ensure we call event on the parent viewer + // We call the event on the parent viewer window no matter what const eventTarget = this.viewer.viewer || this.viewer; - const supportedFormats = eventTarget.drawer.getSupportedDataFormats(); - const keepInternalCacheCopy = eventTarget.drawer.options.usePrivateCache; - const drawerId = eventTarget.drawer.getId(); + // However, we must pick the correct drawer reference (navigator VS viewer) + const supportedFormats = this.viewer.drawer.getSupportedDataFormats(); + const keepInternalCacheCopy = this.viewer.drawer.options.usePrivateCache; + const drawerId = this.viewer.drawer.getId(); const jobList = tileList.map(tile => { if (restoreTiles) {