Switch Random.id() to Math.random() for triggering reactive updates. Random.id() is taking 40ms on Chrome for some reason

This commit is contained in:
Erik Ziegler committed 2017-10-25 13:11:44 +02:00
1 parent 05d9a41f45
commit 37fff25b50
7 files changed
+16 -17

No files matched your search

@@ -30,7 +30,7 @@ export class LayoutManager {
this.isZoomed = false;
const updateSessionFn = () => Tracker.afterFlush(() => Session.set('LayoutManagerUpdated', Random.id()));
const updateSessionFn = () => Tracker.afterFlush(() => Session.set('LayoutManagerUpdated', Math.random()));
this.updateSession = _.throttle(updateSessionFn, 300);
}
@@ -188,7 +188,7 @@ const toggleDialog = element => {
$element.toggleClass('dialog-open', !isClosed);
}
Session.set('UpdateCINE', Random.id());
Session.set('UpdateCINE', Math.random());
};
// Toggle the play/stop state for the cornerstone clip tool
@@ -204,7 +204,7 @@ const toggleCinePlay = () => {
}
// Update the UpdateCINE session property
Session.set('UpdateCINE', Random.id());
Session.set('UpdateCINE', Math.random());
};
// Show/hide the CINE dialog
@@ -305,7 +305,7 @@ const isStackScrollLinkingDisabled = () => {
};
// Create an event listener to update playing state when a clip stops playing
$(window).on('CornerstoneToolsClipStopped', () => Session.set('UpdateCINE', Random.id()));
$(window).on('CornerstoneToolsClipStopped', () => Session.set('UpdateCINE', Math.random()));
/**
* Export functions inside viewportUtils namespace.