Fix: reference the correct drawer in invalidation routine.

This commit is contained in:
Aiosa 2024-11-07 12:01:02 +01:00
parent 535507568f
commit 3b1b2d6d23

View File

@ -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) {