From 856f00994b59abab4d0ee4759654c042433e1554 Mon Sep 17 00:00:00 2001 From: Ian Gilman Date: Tue, 23 Feb 2016 09:22:53 -0800 Subject: [PATCH] Changelog for #853 --- changelog.txt | 1 + src/overlay.js | 3 +-- src/viewer.js | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/changelog.txt b/changelog.txt index b5e17942..3b9e79f5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,6 +23,7 @@ Viewport.contentAspectY have been removed. * Fixed navigator not being rotated when viewport rotation is set in constructor (#840) * Fixed: Viewer.setMouseNavEnabled wasn't affecting all of the viewer's trackers (#845) * Fixed: with scrollToZoom disabled, the viewer caused page scrolling to slow down (#858) +* Added Viewer.getOverlayById and Overlay.getBounds functions (#853) 2.1.0: diff --git a/src/overlay.js b/src/overlay.js index ac464c7a..ffdd21bd 100644 --- a/src/overlay.js +++ b/src/overlay.js @@ -313,15 +313,14 @@ placement : $.OverlayPlacement.TOP_LEFT; }, + /** * @function * @returns {OpenSeadragon.Rect} overlay bounds */ getBounds: function() { - return this.bounds.clone(); } - }; }( OpenSeadragon )); diff --git a/src/viewer.js b/src/viewer.js index b8c13c06..d96f81c0 100644 --- a/src/viewer.js +++ b/src/viewer.js @@ -1944,28 +1944,28 @@ $.extend( $.Viewer.prototype, $.EventSource.prototype, $.ControlDock.prototype, this.raiseEvent( 'clear-overlay', {} ); return this; }, - + /** * Finds an overlay identified by the reference element or element id * and returns it as an object, return null if not found. * @method * @param {Element|String} element - A reference to the element or an - * element id which represent the overlay content. + * element id which represents the overlay content. * @return {OpenSeadragon.Overlay} the matching overlay or null if none found. */ getOverlayById: function( element ) { var i; element = $.getElement( element ); - i = getOverlayIndex( this.currentOverlays, element ); - + i = getOverlayIndex( this.currentOverlays, element ); + if (i>=0) { return this.currentOverlays[i]; } else { return null; } - }, + /** * Updates the sequence buttons. * @function OpenSeadragon.Viewer.prototype._updateSequenceButtons