PWV-1: Fixing modal incrementing body padding issues
This commit is contained in:
parent
710499c10b
commit
107a6538a7
@ -1,19 +1,28 @@
|
||||
<template name="dialogForm">
|
||||
<div id="{{this.id}}" class="modal fade" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog {{this.dialogClass}}" role="document">
|
||||
{{#form class='modal-content' api=instance.api schema=this.schema hideValidationBox=true}}
|
||||
{{#form class='modal-content' hideValidationBox=true
|
||||
api=instance.api schema=this.schema
|
||||
}}
|
||||
<div class="modal-header">
|
||||
{{#button class='close' action='cancel' tagAttributes=(extend this.tagAttributes aria-label='Close')}}
|
||||
<span aria-hidden="true">×</span>
|
||||
{{/button}}
|
||||
{{#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 class="modal-footer">
|
||||
{{#button class='btn btn-default' action='cancel'}}{{choose this.cancelLabel 'Cancel'}}{{/button}}
|
||||
{{#button class='btn btn-primary' action='confirm'}}{{choose this.confirmLabel 'Confirm'}}{{/button}}
|
||||
{{#button class='btn btn-default'
|
||||
action='cancel'
|
||||
tagAttributes=(extend this.tagAttributes data-dismiss='modal')
|
||||
}}{{choose this.cancelLabel 'Cancel'}}{{/button}}
|
||||
{{#button class='btn btn-primary'
|
||||
action='confirm'
|
||||
}}{{choose this.confirmLabel 'Confirm'}}{{/button}}
|
||||
</div>
|
||||
{{/form}}
|
||||
</div>
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
import { Template } from 'meteor/templating';
|
||||
import { _ } from 'meteor/underscore';
|
||||
|
||||
Template.dialogForm.onCreated(() => {
|
||||
Template.dialogForm.onRendered(() => {
|
||||
const instance = Template.instance();
|
||||
|
||||
const $modal = instance.$('.modal');
|
||||
|
||||
instance.api = {
|
||||
|
||||
confirm() {
|
||||
@ -13,6 +15,9 @@ Template.dialogForm.onCreated(() => {
|
||||
return;
|
||||
}
|
||||
|
||||
// Hide the modal, removing the backdrop
|
||||
$modal.modal('hide');
|
||||
|
||||
// Get the form value and call the confirm callback or resolve the promise
|
||||
const formData = form.value();
|
||||
if (_.isFunction(instance.data.confirmCallback)) {
|
||||
@ -23,6 +28,9 @@ Template.dialogForm.onCreated(() => {
|
||||
},
|
||||
|
||||
cancel() {
|
||||
// Hide the modal, removing the backdrop
|
||||
$modal.modal('hide');
|
||||
|
||||
// Call the cancel callback or resolve the promise
|
||||
if (_.isFunction(instance.data.cancelCallback)) {
|
||||
instance.data.cancelCallback(instance.data.promiseReject);
|
||||
@ -43,10 +51,4 @@ Template.dialogForm.onRendered(() => {
|
||||
backdrop: 'static',
|
||||
keyboard: false
|
||||
});
|
||||
|
||||
// Remove the created modal backdrop from DOM after promise is done
|
||||
const $backdrop = $modal.next('.modal-backdrop');
|
||||
const dismissDialogBackdrop = () => $backdrop.remove();
|
||||
instance.data.promise.then(dismissDialogBackdrop, dismissDialogBackdrop);
|
||||
|
||||
});
|
||||
|
||||
@ -1,65 +1,67 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { Mongo } from 'meteor/mongo';
|
||||
import { OHIF } from 'meteor/ohif:core';
|
||||
import { measurementTools } from 'meteor/ohif:lesiontracker/both/configuration/measurementTools';
|
||||
|
||||
let MeasurementCollections = {};
|
||||
measurementTools.forEach(tool => {
|
||||
MeasurementCollections[tool.id] = new Mongo.Collection(tool.id);
|
||||
MeasurementCollections[tool.id] = new Mongo.Collection(tool.id);
|
||||
});
|
||||
|
||||
|
||||
|
||||
Timepoints = new Mongo.Collection('timepoints');
|
||||
|
||||
// Drop our collections for testing purposes
|
||||
Meteor.startup(() => {
|
||||
Timepoints.remove({});
|
||||
measurementTools.forEach(tool => {
|
||||
MeasurementCollections[tool.id].remove({});
|
||||
});
|
||||
})
|
||||
Timepoints.remove({});
|
||||
measurementTools.forEach(tool => {
|
||||
MeasurementCollections[tool.id].remove({});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// TODO: Make storage use update instead of clearing the entire collection and
|
||||
// TODO: Make storage use update instead of clearing the entire collection and
|
||||
// re-inserting everything.
|
||||
Meteor.methods({
|
||||
storeTimepoints(timepoints) {
|
||||
console.log('Storing Timepoints on the Server')
|
||||
console.log(JSON.stringify(timepoints, null, 2));
|
||||
Timepoints.remove({});
|
||||
timepoints.forEach(timepoint => {
|
||||
delete timepoint._id;
|
||||
Timepoints.insert(timepoint);
|
||||
});
|
||||
},
|
||||
storeTimepoints(timepoints) {
|
||||
OHIF.log.info('Storing Timepoints on the Server');
|
||||
OHIF.log.info(JSON.stringify(timepoints, null, 2));
|
||||
Timepoints.remove({});
|
||||
timepoints.forEach(timepoint => {
|
||||
delete timepoint._id;
|
||||
Timepoints.insert(timepoint);
|
||||
});
|
||||
},
|
||||
|
||||
retrieveTimepoints() {
|
||||
console.log('Retrieving Timepoints from the Server');
|
||||
return Timepoints.find().fetch();
|
||||
},
|
||||
retrieveTimepoints() {
|
||||
OHIF.log.info('Retrieving Timepoints from the Server');
|
||||
return Timepoints.find().fetch();
|
||||
},
|
||||
|
||||
storeMeasurements(measurementData) {
|
||||
console.log('Storing Measurements on the Server')
|
||||
console.log(JSON.stringify(measurementData, null, 2));
|
||||
storeMeasurements(measurementData) {
|
||||
OHIF.log.info('Storing Measurements on the Server');
|
||||
OHIF.log.info(JSON.stringify(measurementData, null, 2));
|
||||
|
||||
Object.keys(measurementData).forEach(toolId => {
|
||||
MeasurementCollections[toolId].remove({});
|
||||
Object.keys(measurementData).forEach(toolId => {
|
||||
if (!MeasurementCollections[toolId]) {
|
||||
return;
|
||||
}
|
||||
|
||||
const measurements = measurementData[toolId];
|
||||
measurements.forEach(measurement => {
|
||||
MeasurementCollections[toolId].insert(measurement);
|
||||
})
|
||||
});
|
||||
},
|
||||
MeasurementCollections[toolId].remove({});
|
||||
|
||||
retrieveMeasurements() {
|
||||
console.log('Retrieving Measurements from the Server');
|
||||
let measurementData = {};
|
||||
const measurements = measurementData[toolId];
|
||||
measurements.forEach(measurement => {
|
||||
MeasurementCollections[toolId].insert(measurement);
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
measurementTools.forEach(tool => {
|
||||
measurementData[tool.id] = MeasurementCollections[tool.id].find().fetch();
|
||||
});
|
||||
retrieveMeasurements() {
|
||||
OHIF.log.info('Retrieving Measurements from the Server');
|
||||
let measurementData = {};
|
||||
|
||||
return measurementData;
|
||||
}
|
||||
});
|
||||
measurementTools.forEach(tool => {
|
||||
measurementData[tool.id] = MeasurementCollections[tool.id].find().fetch();
|
||||
});
|
||||
|
||||
return measurementData;
|
||||
}
|
||||
});
|
||||
|
||||
@ -107,7 +107,7 @@ $spacerY = 12px
|
||||
&
|
||||
&:before
|
||||
&:after
|
||||
theme('border', '$borderThickness solid $primaryBackgroundColor')
|
||||
theme('border', '%s solid $primaryBackgroundColor' % $borderThickness)
|
||||
theme('background-color', '$boxBackgroundColor')
|
||||
border-radius: $boxBorderRadius
|
||||
height: $boxWidth + ($borderThickness * 2)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user