Commit 01f2f81c by Adam Palay

Merge remote-tracking branch 'origin/release' into merge-conflicts-release

Conflicts:
	common/static/js/vendor/ova/OpenSeaDragonAnnotation.js
parents fbd9cc13 79a3bfcb
...@@ -581,10 +581,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ...@@ -581,10 +581,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// would require changing annotations that were already made, instead we check if // would require changing annotations that were already made, instead we check if
// the id is a substring of the thumbnail, which according to OpenSeaDragon API should be the case. // the id is a substring of the thumbnail, which according to OpenSeaDragon API should be the case.
var sourceId = this.viewer.source['@id']; var sourceId = this.viewer.source['@id'];
var targetThumb = an.target.thumb;
// code runs on annotation creation before thumbnail is created
var targetThumb = an.target ? an.target.thumb : false;
if (isContainer) { if (isContainer) {
isSource = (targetThumb.indexOf(sourceId) !== -1); // reason why this is okay is that we are trying to ascertain that the annotation
} // is related to the image drawn. If thumbnail attribute is empty it means the annotation
// was just created and should still be considered an annotation of this image.
isSource = targetThumb ? (targetThumb.indexOf(sourceId) !== -1) : true;
}
return (isOpenSeaDragon && isContainer && isImage && isRP && isSource); return (isOpenSeaDragon && isContainer && isImage && isRP && isSource);
}, },
...@@ -842,13 +847,13 @@ Annotator.Plugin.OpenSeaDragon = (function(_super) { ...@@ -842,13 +847,13 @@ Annotator.Plugin.OpenSeaDragon = (function(_super) {
// Makes sure OSD exists and that annotation is an image annotation // Makes sure OSD exists and that annotation is an image annotation
// with a position in the OSD instance // with a position in the OSD instance
var isOpenSeaDragon = (typeof annotator.osda != 'undefined'); var isOpenSeaDragon = (typeof annotator.osda != 'undefined');
var isContainer = (typeof an.target!='undefined' && an.target.container==this.viewer.id ); var isContainer = (typeof an.target!='undefined' && an.target.container==osda.viewer.id );
var isImage = (typeof an.media!='undefined' && an.media=='image'); var isImage = (typeof an.media!='undefined' && an.media=='image');
var isRP = (typeof rp!='undefined'); var isRP = (typeof rp!='undefined');
var isSource = false; var isSource = false;
// Double checks that the image being displayed matches the annotations // Double checks that the image being displayed matches the annotations
var source = this.viewer.source; var source = osda.viewer.source;
var tilesUrl = typeof source.tilesUrl!='undefined'?source.tilesUrl:''; var tilesUrl = typeof source.tilesUrl!='undefined'?source.tilesUrl:'';
var functionUrl = typeof source.getTileUrl!='undefined'?source.getTileUrl:''; var functionUrl = typeof source.getTileUrl!='undefined'?source.getTileUrl:'';
var compareUrl = tilesUrl!=''?tilesUrl:('' + functionUrl).replace(/\s+/g, ' '); var compareUrl = tilesUrl!=''?tilesUrl:('' + functionUrl).replace(/\s+/g, ' ');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment