diff --git a/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js b/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js index 950718f337..a3da590ca3 100644 --- a/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js +++ b/common/static/js/vendor/ova/OpenSeaDragonAnnotation.js @@ -582,7 +582,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // the id is a substring of the thumbnail, which according to OpenSeaDragon API should be the case. var sourceId = this.viewer.source['@id']; var targetThumb = an.target.thumb; - if (isContainer) isSource = (targetThumb.indexOf(sourceId) !== -1); + if (isContainer) { + isSource = (targetThumb.indexOf(sourceId) !== -1); + } return (isOpenSeaDragon && isContainer && isImage && isRP && isSource); }, diff --git a/common/static/js/vendor/ova/catch/js/catch.js b/common/static/js/vendor/ova/catch/js/catch.js index 1711c1b44c..75f037fc8d 100644 --- a/common/static/js/vendor/ova/catch/js/catch.js +++ b/common/static/js/vendor/ova/catch/js/catch.js @@ -874,7 +874,9 @@ CatchAnnotation.prototype = { var an = allannotations[item]; // Makes sure that all images are set to transparent in case one was // previously selected. - an.highlights[0].style.background = "rgba(0, 0, 0, 0)"; + if (an.highlights) { + an.highlights[0].style.background = "rgba(0, 0, 0, 0)"; + } if (typeof an.id !== 'undefined' && an.id === osdaId) { // this is the annotation var bounds = new OpenSeadragon.Rect(an.bounds.x, an.bounds.y, an.bounds.width, an.bounds.height); osda.viewer.viewport.fitBounds(bounds, false); @@ -883,7 +885,9 @@ CatchAnnotation.prototype = { 'slow'); // signifies a selected annotation once OSD has zoomed in on the // appropriate area, it turns the background a bit yellow - an.highlights[0].style.background = "rgba(255, 255, 10, 0.2)"; + if (an.highlights !== undefined) { + an.highlights[0].style.background = "rgba(255, 255, 10, 0.2)"; + } } } }, @@ -912,7 +916,7 @@ CatchAnnotation.prototype = { startOffset = hasRanges?an.ranges[0].startOffset:'', endOffset = hasRanges?an.ranges[0].endOffset:''; - if (typeof startOffset !== 'undefined' && typeof endOffset !== 'undefined') { + if (typeof startOffset !== 'undefined' && typeof endOffset !== 'undefined' && typeof an.highlights) { $(an.highlights).parent().find('.annotator-hl').removeClass('api'); // change the color