fix(modals) Fixing DOM issues with modals

This commit is contained in:
Bruno Alves de Faria authored and Erik Ziegler committed 2018-07-12 12:11:14 +02:00
1 parent 2c790ff674
commit 50374038a3
3 files changed
+24 -5

No files matched your search

@@ -1,7 +1,7 @@
<template name="dialogConfirm">
{{>dialogForm (extend this
{{#dialogForm (extend this
dialogClass='modal-sm'
title=(choose this.title 'Confirmation')
message=(choose this.message 'Are you sure you want to perform this action?')
)}}
message=(valueIf UI.contentBlock '' (choose this.message 'Are you sure you want to perform this action?'))
)}}{{>UI.contentBlock}}{{/dialogForm}}
</template>
@@ -7,8 +7,7 @@ Template.dialogSimple.onCreated(() => {
const instance = Template.instance();
instance.close = () => {
const $modal = instance.$('.modal');
$modal.one('hidden.bs.modal', () => instance.data.promiseResolve()).modal('hide');
instance.$('.modal').modal('hide');
};
// Automatically close the modal if a timeout value was given
@@ -31,6 +30,9 @@ Template.dialogSimple.onRendered(() => {
// Create the bootstrap modal
$modal.modal(modalOptions);
// Resolve the promise as soon as the modal is closed
$modal.one('hidden.bs.modal', () => instance.data.promiseResolve());
let position = instance.data.position;
const { event } = instance.data;