From f8503bd6ac3cc115ab3aad58451c766bce196ed7 Mon Sep 17 00:00:00 2001 From: Philip Giuliani Date: Fri, 10 Apr 2015 14:31:08 +0200 Subject: [PATCH] Add placeholderFillStyle option to tiledImage --- src/openseadragon.js | 2 +- src/tiledimage.js | 2 +- src/viewer.js | 9 +++++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index ec5b0ed5..b46a641e 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -206,7 +206,7 @@ * @property {Number} [opacity=1] * Opacity of the drawer (1=opaque, 0=transparent) * - * @property {String|Function} [placeholderFillStyle=null] + * @property {String|CanvasGradient|CanvasPattern|Function} [placeholderFillStyle=null] * Draws a colored rectangle behind the tile if it is not loaded yet. * * @property {Number} [degrees=0] diff --git a/src/tiledimage.js b/src/tiledimage.js index d008f6e4..da40bde7 100644 --- a/src/tiledimage.js +++ b/src/tiledimage.js @@ -65,7 +65,7 @@ * @param {Boolean} [options.alwaysBlend] - See {@link OpenSeadragon.Options}. * @param {Number} [options.minPixelRatio] - See {@link OpenSeadragon.Options}. * @param {Boolean} [options.debugMode] - See {@link OpenSeadragon.Options}. - * @param {String|Function} [options.placeholderFillStyle] - See {@link OpenSeadragon.Options}. + * @param {String|CanvasGradient|CanvasPattern|Function} [options.placeholderFillStyle] - See {@link OpenSeadragon.Options}. * @param {String|Boolean} [options.crossOriginPolicy] - See {@link OpenSeadragon.Options}. */ $.TiledImage = function( options ) { diff --git a/src/viewer.js b/src/viewer.js index 562b50b2..a73ef24b 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1206,6 +1206,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, * and "source" properties. * @param {Boolean} [options.collectionImmediately=false] If collectionMode is on, * specifies whether to snap to the new arrangement immediately or to animate to it. + * @param {String|CanvasGradient|CanvasPattern|Function} [options.placeholderFillStyle] - See {@link OpenSeadragon.Options}. * @fires OpenSeadragon.World.event:add-item * @fires OpenSeadragon.Viewer.event:add-item-failed */ @@ -1217,6 +1218,10 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, this._hideMessage(); + $.extend ( true, options, { + placeholderFillStyle: _this.placeholderFillStyle + }); + var myQueueItem = { options: options }; @@ -1284,6 +1289,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, width: queueItem.options.width, height: queueItem.options.height, clip: queueItem.options.clip, + placeholderFillStyle: queueItem.options.placeholderFillStyle, springStiffness: _this.springStiffness, animationTime: _this.animationTime, minZoomImageRatio: _this.minZoomImageRatio, @@ -1294,8 +1300,7 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, alwaysBlend: _this.alwaysBlend, minPixelRatio: _this.minPixelRatio, crossOriginPolicy: _this.crossOriginPolicy, - debugMode: _this.debugMode, - placeholderFillStyle: _this.placeholderFillStyle + debugMode: _this.debugMode }); _this.world.addItem( tiledImage, {