Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/BootstrapBlazor.Server/Components/Samples/Modals.razor
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@
Name="IsDraggable">
<Button OnClick="() => DragModal.Toggle()">@Localizer["ModalsNormalPopups"]</Button>
<Modal @ref="DragModal">
<ModalDialog Title="@Localizer["ModalsNormalDefaultPopup"]" IsDraggable="true" ShowMaximizeButton="true">
<ModalDialog Title="@Localizer["ModalsNormalDefaultPopup"]" IsDraggable="true">
<BodyTemplate>
<div>@Localizer["ModalsTitlePopupWindowText"]</div>
</BodyTemplate>
Expand Down
11 changes: 2 additions & 9 deletions src/BootstrapBlazor/Components/Modal/Modal.razor.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,6 @@ export function init(id, invoke, shownCallback, closeCallback) {
})
EventHandler.on(el, 'hidden.bs.modal', e => {
e.stopPropagation();
if (modal.draggable) {
modal.dialog.style.width = ''
modal.dialog.style.margin = ''

EventHandler.off(modal.dialog, 'mousedown')
EventHandler.off(modal.dialog, 'touchstart')
}
invoke.invokeMethodAsync(closeCallback)
})
EventHandler.on(window, 'popstate', modal.pop)
Expand Down Expand Up @@ -154,13 +147,13 @@ export function dispose(id) {
}

const backupBodyStyle = modal => {
if(modal.originalStyle === void 0) {
if (modal.originalStyle === null) {
modal.originalStyle = document.body.style.cssText;
}
}

const restoreBodyStyle = modal => {
if(modal.originalStyle !== void 0) {
if (modal.originalStyle !== null) {
document.body.style.cssText = modal.originalStyle;
delete modal.originalStyle;
}
Expand Down