From 413e40a64cf29241d2d8a12434a2dd92b63641c3 Mon Sep 17 00:00:00 2001 From: Robert Saric Date: Thu, 6 Jul 2017 21:59:26 +0200 Subject: [PATCH 1/2] fix for #1209 (Reference strip using "thumbs") --- src/imagetilesource.js | 1 + src/referencestrip.js | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/imagetilesource.js b/src/imagetilesource.js index 417243c6..0bf26844 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -50,6 +50,7 @@ * @extends OpenSeadragon.TileSource * @param {Object} options Options object. * @param {String} options.url URL of the image + * @param {String} options.referenceStripThumbnailUrl URL of the dedicated thumbnail image * @param {Boolean} [options.buildPyramid=true] If set to true (default), a * pyramid will be built internally to provide a better downsampling. * @param {String|Boolean} [options.crossOriginPolicy=false] Valid values are diff --git a/src/referencestrip.js b/src/referencestrip.js index 69fa8e29..e1074572 100644 --- a/src/referencestrip.js +++ b/src/referencestrip.js @@ -428,9 +428,19 @@ function loadPanels( strip, viewerSize, scroll ) { for ( i = activePanelsStart; i < activePanelsEnd && i < strip.panels.length; i++ ) { element = strip.panels[i]; if ( !element.activePanel ) { + var miniTileSource; + var originalTileSource = strip.viewer.tileSources[i]; + if (originalTileSource.referenceStripThumbnailUrl) { + miniTileSource = { + type: 'image', + url: originalTileSource.referenceStripThumbnailUrl + }; + } else { + miniTileSource = originalTileSource; + } miniViewer = new $.Viewer( { id: element.id, - tileSources: [strip.viewer.tileSources[i]], + tileSources: [miniTileSource], element: element, navigatorSizeRatio: strip.sizeRatio, showNavigator: false, From 57103a5dd4bf0d1d64bb7f39f2d3707174dccfd6 Mon Sep 17 00:00:00 2001 From: Robert Saric Date: Mon, 10 Jul 2017 20:19:13 +0200 Subject: [PATCH 2/2] fix for #1209 (Reference strip using "thumbs") additional changes --- src/imagetilesource.js | 1 - src/tilesource.js | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imagetilesource.js b/src/imagetilesource.js index 0bf26844..417243c6 100644 --- a/src/imagetilesource.js +++ b/src/imagetilesource.js @@ -50,7 +50,6 @@ * @extends OpenSeadragon.TileSource * @param {Object} options Options object. * @param {String} options.url URL of the image - * @param {String} options.referenceStripThumbnailUrl URL of the dedicated thumbnail image * @param {Boolean} [options.buildPyramid=true] If set to true (default), a * pyramid will be built internally to provide a better downsampling. * @param {String|Boolean} [options.crossOriginPolicy=false] Valid values are diff --git a/src/tilesource.js b/src/tilesource.js index e83c4fab..bb3e433e 100644 --- a/src/tilesource.js +++ b/src/tilesource.js @@ -60,6 +60,8 @@ * the extending classes implementation of 'configure'. * @param {String} [options.url] * The URL for the data necessary for this TileSource. + * @param {String} [options.referenceStripThumbnailUrl] + * The URL for the thumbnail image to be used by the reference strip * @param {Function} [options.success] * A function to be called upon successful creation. * @param {Boolean} [options.ajaxWithCredentials]