mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-26 06:16:56 +09:00
refactor: replace Fomantic modal with native dialog (#39846)
Replace Fomantic's hard-forked jQuery modal with native `<dialog>` elements, advancing https://github.com/go-gitea/gitea/issues/29849. The UI is visually unchanged. Dialogs open with `show()` over an `inert` page, so tooltips, popups and toasts mounted on `<body>` stay usable above them, unlike with `showModal()` (https://github.com/whatwg/html/issues/9936). - Remove the Fomantic modal and dimmer, add `showModal` and `hideModal` - Declare modals as `<dialog class="modal-dialog">`, shown inside a `.modal-backdrop`, instead of `ui modal` with its unused size classes - Remove two modals that could never be opened - Block the page while a modal is open, close the topmost one on Escape and restore focus to its opener - Allow stacked modals, use a confirm modal instead of `window.confirm` for deleting content history - Hide popups and toasts when a modal opens or closes - Keep the release notes modal open when generating notes fails Fixes: https://github.com/go-gitea/gitea/issues/39643 Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
1 parent
7610336d74
commit
e645afbb3f
95 files changed
+607
-1719
No files matched your search
@@ -223,7 +223,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui g-modal-confirm delete modal" id="delete-user-modal">
|
||||
<dialog class="modal-dialog" id="delete-user-modal">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "settings.delete_account_title"}}
|
||||
@@ -241,6 +241,6 @@
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
|
||||
{{template "admin/layout_footer" .}}
|
||||
@@ -5,18 +5,20 @@
|
||||
<span>{{ctx.Locale.Tr "settings.organization"}} ({{ctx.Locale.Tr "admin.total" $userOrgsTotal}})</span>
|
||||
{{if $userOrgs}}
|
||||
<button type="button" class="ui red tiny button show-modal" data-modal="#remove-all-orgs-modal">{{ctx.Locale.Tr "remove_all"}}</button>
|
||||
<form class="ui small modal form-fetch-action" id="remove-all-orgs-modal" method="post" action="{{ctx.RootData.Link}}/orgs/remove-all">
|
||||
<dialog class="modal-dialog" id="remove-all-orgs-modal">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "admin.users.remove_all_orgs_title"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "admin.users.remove_all_orgs_desc" $user.Name $userOrgsTotal}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</div>
|
||||
<button class="ui red button" type="submit">{{ctx.Locale.Tr "remove_all"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
<form class="form-fetch-action" method="post" action="{{ctx.RootData.Link}}/orgs/remove-all">
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "admin.users.remove_all_orgs_desc" $user.Name $userOrgsTotal}}</p>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<div class="ui cancel button">{{ctx.Locale.Tr "settings.cancel"}}</div>
|
||||
<button class="ui red button" type="submit">{{ctx.Locale.Tr "remove_all"}}</button>
|
||||
</div>
|
||||
</form>
|
||||
</dialog>
|
||||
{{end}}
|
||||
</h4>
|
||||
|
||||
|
||||
Reference in new issue
Block a user