Avoid exceptions for disabled elements (PR #179)

If playClip is enabled and the user loads a different series in the
viewport an exception will be thrown because the element will not be
enabled anymore.

Pull request
https://github.com/chafey/cornerstoneTools/pull/179
This commit is contained in:
Leonardo Campos 2017-01-26 20:41:15 -02:00
parent a01a86ac7e
commit aa88fe181a

View File

@ -8947,7 +8947,15 @@ Display scroll progress bar across bottom of image.
clearTimeout(resetPrefetchTimeout);
resetPrefetchTimeout = setTimeout(function() {
var element = e.target;
prefetch(element);
// If playClip is enabled and the user loads a different series in the viewport
// an exception will be thrown because the element will not be enabled anymore
try {
prefetch(element);
} catch(error) {
return;
}
}, resetPrefetchDelay);
}