Final adjustments to routing behaviors
This commit is contained in:
1 parent
9ccebb76bd
commit
e12fb0de35
24 files changed
+226
-362
No files matched your search
+9
-2
@@ -245,7 +245,7 @@ Template.studylistResult.onRendered(() => {
|
||||
endDate = today;
|
||||
}
|
||||
|
||||
const datePicker = $studyDate.daterangepicker({
|
||||
instance.datePicker = $studyDate.daterangepicker({
|
||||
maxDate: today,
|
||||
autoUpdateInput: true,
|
||||
startDate: startDate,
|
||||
@@ -258,7 +258,7 @@ Template.studylistResult.onRendered(() => {
|
||||
}).data('daterangepicker');
|
||||
|
||||
if (startDate && endDate) {
|
||||
datePicker.updateInputText();
|
||||
instance.datePicker.updateInputText();
|
||||
$studyDate.trigger('change');
|
||||
} else {
|
||||
// Retrieve all studies
|
||||
@@ -266,6 +266,13 @@ Template.studylistResult.onRendered(() => {
|
||||
}
|
||||
});
|
||||
|
||||
Template.studylistResult.onDestroyed(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
// Destroy the daterangepicker to prevent residual elements on DOM
|
||||
instance.datePicker.remove();
|
||||
});
|
||||
|
||||
function resetSortingColumns(instance, sortingColumn) {
|
||||
Object.keys(instance.sortingColumns.keys).forEach(key => {
|
||||
if (key !== sortingColumn) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { Blaze } from 'meteor/blaze';
|
||||
import * as Hammer from 'hammerjs';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
// Clear all selected studies
|
||||
|
||||
@@ -1,41 +1,27 @@
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { Viewerbase } from 'meteor/ohif:viewerbase';
|
||||
import { Router } from 'meteor/iron:router';
|
||||
|
||||
// Classes
|
||||
import { OHIFStudyMetadataSource } from './OHIFStudyMetadataSource';
|
||||
import { OHIFStudySummary } from './OHIFStudySummary';
|
||||
|
||||
// Functions
|
||||
import { getStudyPriors } from './getStudyPriors';
|
||||
import { getStudyPriorsMap } from './getStudyPriorsMap';
|
||||
|
||||
StudyList = {
|
||||
functions: {
|
||||
getStudyPriors,
|
||||
getStudyPriorsMap
|
||||
},
|
||||
classes: {
|
||||
OHIFStudyMetadataSource,
|
||||
OHIFStudySummary
|
||||
}
|
||||
OHIF.studylist.functions = {
|
||||
getStudyPriors,
|
||||
getStudyPriorsMap
|
||||
};
|
||||
|
||||
OHIF.studylist.classes = {
|
||||
OHIFStudyMetadataSource,
|
||||
OHIFStudySummary
|
||||
};
|
||||
|
||||
const dblClickOnStudy = data => {
|
||||
Router.go('viewerStudies', { studyInstanceUids: data.studyInstanceUid });
|
||||
};
|
||||
|
||||
OHIF.studylist.callbacks.dblClickOnStudy = dblClickOnStudy;
|
||||
OHIF.studylist.callbacks.middleClickOnStudy = dblClickOnStudy;
|
||||
|
||||
function dblClickOnStudy(data) {
|
||||
openNewTab(data.studyInstanceUid);
|
||||
}
|
||||
|
||||
let currentServerChangeHandlerFirstRun = true;
|
||||
const currentServerChangeHandler = () => {
|
||||
if (currentServerChangeHandlerFirstRun) {
|
||||
currentServerChangeHandlerFirstRun = false;
|
||||
return;
|
||||
}
|
||||
|
||||
switchToTab('studylistTab');
|
||||
};
|
||||
|
||||
CurrentServer.find().observe({
|
||||
added: currentServerChangeHandler,
|
||||
changed: currentServerChangeHandler
|
||||
});
|
||||
Reference in new issue
Block a user