LT-259 New proactive UI (three options) for unsaved changes dialog + New API for unsaved changes module (now handlers can be attached to unsaved changes namespace) + Save measurements integration.

This commit is contained in:
Emanuel F. Oliveira committed 2016-11-21 10:22:33 -02:00
1 parent 4a3b01a4f6
commit 91bafb367c
10 files changed
+671 -173

No files matched your search

+27 -11
View File
@@ -18,21 +18,37 @@ Template.app.onRendered(() => {
});
Template.app.events({
'click .js-toggle-studyList'() {
'click .js-toggle-studyList'(event) {
const contentId = Session.get('activeContentId');
OHIF.ui.unsavedChanges.checkBeforeAction('viewer.*', function(shouldProceed, hasChanges) {
if (shouldProceed) {
// Drop signaled unsaved changes if any...
if (hasChanges) {
OHIF.ui.unsavedChanges.clear('viewer.*');
OHIF.ui.unsavedChanges.presentProactiveDialog('viewer.*', (hasChanges, userChoice) => {
if (hasChanges) {
switch (userChoice) {
case 'abort-action':
return;
case 'save-changes':
OHIF.ui.unsavedChanges.trigger('viewer', 'save', false);
OHIF.ui.unsavedChanges.clear('viewer.*');
break;
case 'abandon-changes':
OHIF.ui.unsavedChanges.clear('viewer.*');
break;
}
if (contentId !== studylistContentId) {
switchToTab(studylistContentId);
} else {
switchToTab(viewerContentId);
}
}
if (contentId !== studylistContentId) {
switchToTab(studylistContentId);
} else {
switchToTab(viewerContentId);
}
}, {
position: {
x: event.clientX + 15,
y: event.clientY + 15
}
});