AWV-1: Fixing grid navigation for 1x1 layout

This commit is contained in:
Bruno Alves de Faria 2016-09-03 12:02:28 -03:00
parent 54481cf716
commit e8930230e7

View File

@ -109,7 +109,8 @@ OHIF.viewer.canMoveDisplaySets = isNext => {
const firstIndex = studyViewports[0].displaySetIndex;
const steps = studyViewports.length;
const amount = study.displaySets.length;
const lastStepIndex = amount - (amount % steps);
const move = (amount % steps) || steps;
const lastStepIndex = amount - move;
if (firstIndex + steps !== lastStepIndex + steps) {
endReached = false;
}
@ -227,7 +228,8 @@ OHIF.viewer.moveMultipleViewportDisplaySets = isNext => {
// Check if the indexes are sequenced or will overflow the array bounds
if (baseIndex >= amount) {
const lastStepIndex = amount - (amount % steps);
const move = (amount % steps) || steps;
const lastStepIndex = amount - move;
if (firstIndex + steps !== lastStepIndex + steps) {
// Reset the index if the display sets are sequenced but shifted
baseIndex = lastStepIndex;