PWV-1: Removing form modal residual padding on body

This commit is contained in:
Bruno Alves de Faria 2016-10-04 16:13:48 -03:00 committed by Erik Ziegler
parent 48002420ca
commit 37fcf9f004
2 changed files with 20 additions and 24 deletions

View File

@ -14,27 +14,27 @@ Template.dialogForm.onCreated(() => {
} }
// Hide the modal, removing the backdrop // Hide the modal, removing the backdrop
instance.$('.modal').modal('hide'); instance.$('.modal').on('hidden.bs.modal', event => {
// Get the form value and call the confirm callback or resolve the promise
// Get the form value and call the confirm callback or resolve the promise const formData = form.value();
const formData = form.value(); if (_.isFunction(instance.data.confirmCallback)) {
if (_.isFunction(instance.data.confirmCallback)) { instance.data.confirmCallback(formData, instance.data.promiseResolve);
instance.data.confirmCallback(formData, instance.data.promiseResolve); } else {
} else { instance.data.promiseResolve(formData);
instance.data.promiseResolve(formData); }
} }).modal('hide');
}, },
cancel() { cancel() {
// Hide the modal, removing the backdrop // Hide the modal, removing the backdrop
instance.$('.modal').modal('hide'); instance.$('.modal').on('hidden.bs.modal', event => {
// Call the cancel callback or resolve the promise
// Call the cancel callback or resolve the promise if (_.isFunction(instance.data.cancelCallback)) {
if (_.isFunction(instance.data.cancelCallback)) { instance.data.cancelCallback(instance.data.promiseReject);
instance.data.cancelCallback(instance.data.promiseReject); } else {
} else { instance.data.promiseReject();
instance.data.promiseReject(); }
} }).modal('hide');
} }
}; };
@ -49,9 +49,4 @@ Template.dialogForm.onRendered(() => {
backdrop: 'static', backdrop: 'static',
keyboard: false 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);
}); });

View File

@ -12,9 +12,10 @@ body
.studylistContainer .studylistContainer
theme('background-color', '$primaryBackgroundColor') theme('background-color', '$primaryBackgroundColor')
margin: 2px auto 0
color: white color: white
width: 100%; margin: 2px auto 0
position: relative
width: 100%
.tab-content .tab-content
width: 100% width: 100%