LT-92: Displaying the criteria nonconformities when clicking the warning icon
This commit is contained in:
1 parent
65b867d1b0
commit
db4792b3de
21 files changed
+137
-54
No files matched your search
@@ -0,0 +1,19 @@
|
||||
<template name="dialogSimple">
|
||||
<div id="{{this.id}}" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog {{this.dialogClass}}" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
{{#button class='close' action='cancel'
|
||||
tagAttributes=(extend this.tagAttributes
|
||||
data-dismiss='modal' aria-label='Close'
|
||||
)
|
||||
}}<span aria-hidden="true">×</span>{{/button}}
|
||||
<h4 class="modal-title">{{this.title}}</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{>UI.contentBlock}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,44 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
Template.dialogSimple.onCreated(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
instance.close = () => {
|
||||
const $modal = instance.$('.modal');
|
||||
$modal.on('hidden.bs.modal', () => instance.data.promiseResolve()).modal('hide');
|
||||
};
|
||||
});
|
||||
|
||||
Template.dialogSimple.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
// Allow options ovewrite
|
||||
const modalOptions = _.extend({
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
}, instance.data.modalOptions);
|
||||
|
||||
const $modal = instance.$('.modal');
|
||||
|
||||
// Create the bootstrap modal
|
||||
$modal.modal(modalOptions);
|
||||
|
||||
const position = instance.data.position;
|
||||
if (position) {
|
||||
OHIF.ui.repositionDialog($modal, position.x, position.y);
|
||||
}
|
||||
});
|
||||
|
||||
Template.dialogSimple.events({
|
||||
keydown(event) {
|
||||
const instance = Template.instance();
|
||||
const keyCode = event.keyCode || event.which;
|
||||
|
||||
if (keyCode === 27) {
|
||||
instance.close();
|
||||
event.stopPropagation();
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -5,6 +5,8 @@ import './dialog/form.html';
|
||||
import './dialog/form.js';
|
||||
import './dialog/login.html';
|
||||
import './dialog/login.js';
|
||||
import './dialog/simple.html';
|
||||
import './dialog/simple.js';
|
||||
import './dialog/unsavedChangesDialog.html';
|
||||
import './dialog/unsavedChangesDialog.js';
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { Blaze } from 'meteor/blaze';
|
||||
import { _ } from 'meteor/underscore';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
|
||||
OHIF.ui.showFormDialog = (templateName, dialogData) => {
|
||||
OHIF.ui.showDialog = (templateName, dialogData) => {
|
||||
// Check if the given template exists
|
||||
const template = Template[templateName];
|
||||
if (!template) {
|
||||
@@ -23,7 +23,7 @@ OHIF.ui.repositionDialog = ($modal, x, y) => {
|
||||
$dialog.css({
|
||||
left,
|
||||
top
|
||||
}).trigger('spatialChanged');
|
||||
}).trigger('spatialChanged').one('transitionend', () => $dialog.trigger('spatialChanged'));
|
||||
|
||||
// Switch the modal to its previous visibility state
|
||||
$modal.toggle(isVisible);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import './bounded/bounded.js';
|
||||
import './dimensional/dimensional.js';
|
||||
import './dialog/form.js';
|
||||
import './dialog/display.js';
|
||||
import './dialog/spatial.js';
|
||||
import './dialog/unsavedChangesDialog.js';
|
||||
import './draggable/draggable.js';
|
||||
|
||||
@@ -417,7 +417,7 @@ export const unsavedChanges = {
|
||||
title: 'You have unsaved changes!',
|
||||
message: "Your changes will be lost if you don't save them before leaving the current page... Are you sure you want to proceed?"
|
||||
}, options);
|
||||
OHIF.ui.showFormDialog('dialogConfirm', dialogOptions).then(function() {
|
||||
OHIF.ui.showDialog('dialogConfirm', dialogOptions).then(function() {
|
||||
// Unsaved changes exist but user confirms action...
|
||||
shouldProceed = true;
|
||||
callback.call(null, shouldProceed, hasChanges);
|
||||
|
||||
Reference in new issue
Block a user