LT-251: Fix isDisplaySetActive highlight on visible thumbnails
This commit is contained in:
parent
75b51df6e7
commit
131fe7ff99
@ -10,19 +10,40 @@ Template.registerHelper('isDisplaySetActive', (displaySetInstanceUid, viewportIn
|
||||
return;
|
||||
}
|
||||
|
||||
let viewportData;
|
||||
if (_.isUndefined(viewportIndex)) {
|
||||
viewportData = layoutManager.viewportData;
|
||||
} else {
|
||||
viewportData = [layoutManager.viewportData[viewportIndex]];
|
||||
}
|
||||
|
||||
// Check if the display set is current visible in any of the layout
|
||||
// manager's displayed viewports. Note that we have to check the
|
||||
// onscreen number of viewports here, since the layout manager will
|
||||
// keep the viewport data of old viewports, even after the layout is changed.
|
||||
//
|
||||
// This behaviour is intentional. If the user displays four viewports, then assigns
|
||||
// display sets to them, and then switches to / from another layout configuration,
|
||||
// we don't want them to lose their specified viewports.
|
||||
let result = false;
|
||||
_.each(viewportData, data => {
|
||||
if (_.isUndefined(viewportIndex)) {
|
||||
// Get the number of viewports that are currently displayed
|
||||
// (Note, viewportData may have more entries!)
|
||||
const currentNumberOfViewports = layoutManager.getNumberOfViewports();
|
||||
|
||||
// Loop through the viewport data up until the currently displayed
|
||||
// number of viewports
|
||||
let viewportData = layoutManager.viewportData;
|
||||
for (let i = 0; i < currentNumberOfViewports; i++) {
|
||||
const data = viewportData[i];
|
||||
|
||||
// If the display set is displayed in this viewport, stop here
|
||||
if (data && data.displaySetInstanceUid === displaySetInstanceUid) {
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const data = layoutManager.viewportData[viewportIndex];
|
||||
|
||||
// If the display set is displayed in this viewport, stop here
|
||||
if (data && data.displaySetInstanceUid === displaySetInstanceUid) {
|
||||
result = true;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user