Skip to content

Commit 82c936c

Browse files
authored
refactor(Modal): remove dialog variable (#5549)
* refactor: 更新脚本 * refactor: 删除冗余代码 * doc: 更新示例 * chore: bump version 9.4.7-beta04
1 parent f93cb6f commit 82c936c

File tree

3 files changed

+4
-11
lines changed

3 files changed

+4
-11
lines changed

src/BootstrapBlazor.Server/Components/Samples/Modals.razor

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
Name="IsDraggable">
238238
<Button OnClick="() => DragModal.Toggle()">@Localizer["ModalsNormalPopups"]</Button>
239239
<Modal @ref="DragModal">
240-
<ModalDialog Title="@Localizer["ModalsNormalDefaultPopup"]" IsDraggable="true" ShowMaximizeButton="true">
240+
<ModalDialog Title="@Localizer["ModalsNormalDefaultPopup"]" IsDraggable="true">
241241
<BodyTemplate>
242242
<div>@Localizer["ModalsTitlePopupWindowText"]</div>
243243
</BodyTemplate>

src/BootstrapBlazor/BootstrapBlazor.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.4.7-beta03</Version>
4+
<Version>9.4.7-beta04</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Modal/Modal.razor.js

+2-9
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ export function init(id, invoke, shownCallback, closeCallback) {
2222
})
2323
EventHandler.on(el, 'hidden.bs.modal', e => {
2424
e.stopPropagation();
25-
if (modal.draggable) {
26-
modal.dialog.style.width = ''
27-
modal.dialog.style.margin = ''
28-
29-
EventHandler.off(modal.dialog, 'mousedown')
30-
EventHandler.off(modal.dialog, 'touchstart')
31-
}
3225
invoke.invokeMethodAsync(closeCallback)
3326
})
3427
EventHandler.on(window, 'popstate', modal.pop)
@@ -154,13 +147,13 @@ export function dispose(id) {
154147
}
155148

156149
const backupBodyStyle = modal => {
157-
if(modal.originalStyle === void 0) {
150+
if (modal.originalStyle === null) {
158151
modal.originalStyle = document.body.style.cssText;
159152
}
160153
}
161154

162155
const restoreBodyStyle = modal => {
163-
if(modal.originalStyle !== void 0) {
156+
if (modal.originalStyle !== null) {
164157
document.body.style.cssText = modal.originalStyle;
165158
delete modal.originalStyle;
166159
}

0 commit comments

Comments
 (0)