Remove duplicated function. Added error handling to imageViewerViewport in cases where DOM element is removed.

This commit is contained in:
Erik Ziegler committed 2015-12-15 16:49:26 -05:00
1 parent b851ffe10a
commit 9027f5d107
3 files changed
+8 -58

No files matched your search

@@ -128,6 +128,14 @@ function loadSeriesIntoViewport(data, templateData) {
// Start loading the image.
cornerstone.loadAndCacheImage(imageId).then(function(image) {
var enabledElement;
try {
enabledElement = cornerstone.getEnabledElement(element);
} catch(error) {
log.warn('Viewport destroyed before loaded image could be displayed');
return;
}
// If there is a saved object containing Cornerstone viewport data
// (e.g. scale, invert, window settings) in the input data, apply it now.
//