OHIF-127: Resizing viewport when window gets resized

This commit is contained in:
Eloízio Salgado committed 2016-11-04 18:32:50 -02:00
1 parent 553eb9e24e
commit 12862aec51
2 files changed
+14 -4

No files matched your search

@@ -1,6 +1,11 @@
Template.viewerMain.onCreated(() => {
// Attach the Window resize listener
$(window).on('resize', handleResize);
// Don't use jQuery here. "window.onresize" will always be null
// If its necessary, check all the code for window.onresize getter
// and change it to jQuery._data(window, 'events')['resize'].
// Otherwise this function will be probably overrided.
// See cineDialog instance.setResizeHandler function
window.addEventListener('resize', handleResize);
// Create the synchronizer used to update reference lines
OHIF.viewer.updateImageSynchronizer = new cornerstoneTools.Synchronizer('CornerstoneNewImage', cornerstoneTools.updateImageSynchronizer);
@@ -24,7 +29,7 @@ Template.viewerMain.onDestroyed(() => {
log.info('viewerMain onDestroyed');
// Remove the Window resize listener
$(window).off('resize', handleResize);
window.removeEventListener('resize', handleResize);
// Destroy the synchronizer used to update reference lines
OHIF.viewer.updateImageSynchronizer.destroy();