mirror of
https://github.com/go-gitea/gitea.git
synced 2026-10-28 16:47:01 +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
@@ -72,13 +72,15 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form class="ui small modal form-fetch-action" method="post" id="remove-team-member">
|
||||
<dialog class="modal-dialog" id="remove-team-member">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "org.members.remove"}}
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "team-name")}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
<form class="form-fetch-action" method="post">
|
||||
<div class="content">
|
||||
<p>{{ctx.Locale.Tr "org.members.remove.detail" (HTMLFormat `<span class="%s"></span>` "name") (HTMLFormat `<span class="%s"></span>` "team-name")}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</dialog>
|
||||
{{template "base/footer" .}}
|
||||
@@ -194,7 +194,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ui small modal" id="delete-team">
|
||||
<dialog class="modal-dialog" id="delete-team">
|
||||
<div class="header">
|
||||
{{svg "octicon-trash"}}
|
||||
{{ctx.Locale.Tr "org.teams.delete_team_title"}}
|
||||
@@ -203,5 +203,5 @@
|
||||
<p>{{ctx.Locale.Tr "org.teams.delete_team_desc"}}</p>
|
||||
</div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
</dialog>
|
||||
{{template "base/footer" .}}
|
||||
@@ -91,7 +91,7 @@
|
||||
</div>
|
||||
{{end}}
|
||||
</div>
|
||||
<div class="ui mini modal" id="org-member-leave-team">
|
||||
<dialog class="modal-dialog" id="org-member-leave-team">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "org.teams.leave"}}
|
||||
</div>
|
||||
@@ -99,4 +99,4 @@
|
||||
<p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "to-leave-team-name")}}</p>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
@@ -63,7 +63,7 @@
|
||||
{{template "base/paginate" .}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="ui mini modal" id="org-member-leave-team">
|
||||
<dialog class="modal-dialog" id="org-member-leave-team">
|
||||
<div class="header">
|
||||
{{ctx.Locale.Tr "org.teams.leave"}}
|
||||
</div>
|
||||
@@ -71,5 +71,5 @@
|
||||
<p>{{ctx.Locale.Tr "org.teams.leave.detail" (HTMLFormat `<span class="%s"></span>` "to-leave-team-name")}}</p>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</form>
|
||||
</div>
|
||||
</dialog>
|
||||
{{template "base/footer" .}}
|
||||
Reference in new issue
Block a user