AWV-1: Preventing looping on display set navigation
This commit is contained in:
1 parent
17f8d87d32
commit
8145e08f66
5 files changed
+54
-9
No files matched your search
@@ -2,11 +2,8 @@ import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.viewer = {};
|
||||
|
||||
// Move display sets forward or backward in the selected viewport
|
||||
OHIF.viewer.moveDisplaySet = isNext => {
|
||||
// Get the selected viewport index
|
||||
const viewportIndex = Session.get('activeViewport');
|
||||
|
||||
// Move display sets forward or backward in the given viewport index
|
||||
OHIF.viewer.moveSingleViewportDisplaySets = (viewportIndex, isNext) => {
|
||||
// Get the selected viewport data
|
||||
const viewportData = window.layoutManager.viewportData[viewportIndex];
|
||||
|
||||
@@ -28,11 +25,21 @@ OHIF.viewer.moveDisplaySet = isNext => {
|
||||
if (isNext) {
|
||||
newIndex++;
|
||||
if (newIndex >= displaySets.length) {
|
||||
// Stop here if looping is now allowing
|
||||
if (!OHIF.uiSettings.displaySetNavigationLoopOverSeries) {
|
||||
return;
|
||||
}
|
||||
|
||||
newIndex = 0;
|
||||
}
|
||||
} else {
|
||||
newIndex--;
|
||||
if (newIndex < 0) {
|
||||
// Stop here if looping is now allowing
|
||||
if (!OHIF.uiSettings.displaySetNavigationLoopOverSeries) {
|
||||
return;
|
||||
}
|
||||
|
||||
newIndex = displaySets.length - 1;
|
||||
}
|
||||
}
|
||||
@@ -43,3 +50,23 @@ OHIF.viewer.moveDisplaySet = isNext => {
|
||||
// Rerender the viewport using the new display set data
|
||||
window.layoutManager.rerenderViewportWithNewDisplaySet(viewportIndex, newDisplaySetData);
|
||||
};
|
||||
|
||||
// Move multiple display sets forward or backward in all viewports
|
||||
OHIF.viewer.moveMultipleViewportDisplaySets = isNext => {
|
||||
// TODO: implement
|
||||
};
|
||||
|
||||
// Move display sets forward or backward
|
||||
OHIF.viewer.moveDisplaySets = isNext => {
|
||||
//Check if navigation is on a single or multiple viewports
|
||||
if (OHIF.uiSettings.displaySetNavigationMultipleViewports) {
|
||||
// Move display sets on multiple viewports
|
||||
OHIF.viewer.moveMultipleViewportDisplaySets(isNext);
|
||||
} else {
|
||||
// Get the selected viewport index
|
||||
const viewportIndex = Session.get('activeViewport');
|
||||
|
||||
// Move display sets on a single viewport
|
||||
OHIF.viewer.moveSingleViewportDisplaySets(viewportIndex, isNext);
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user