Initial work on Nucleus parity merge

This commit is contained in:
Emanuel F. Oliveira committed 2017-01-29 22:11:17 -02:00
1 parent aa88fe181a
commit 680beb163f
38 files changed
+4353 -1

No files matched your search

@@ -0,0 +1,53 @@
import { Session } from 'meteor/session';
import { $ } from 'meteor/jquery';
import { OHIF } from 'meteor/ohif:core';
import { setActiveViewport } from './setActiveViewport';
const loadPreviousActivePanel = () => {
OHIF.log.info('nextActivePanel');
let currentIndex = Session.get('activeViewport');
currentIndex--;
const viewports = $('.imageViewerViewport');
const numViewports = viewports.length;
if (currentIndex < 0) {
currentIndex = numViewports - 1;
}
const element = viewports.get(currentIndex);
if (!element) {
return;
}
setActiveViewport(element);
};
const loadNextActivePanel = () => {
OHIF.log.info('nextActivePanel');
let currentIndex = Session.get('activeViewport');
currentIndex++;
const viewports = $('.imageViewerViewport');
const numViewports = viewports.length;
if (currentIndex >= numViewports) {
currentIndex = 0;
}
const element = viewports.get(currentIndex);
if (!element) {
return;
}
setActiveViewport(element);
};
/**
* Export functions inside panelNavigation namespace.
*/
const panelNavigation = {
loadPreviousActivePanel,
loadNextActivePanel
};
export { panelNavigation };