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
@@ -94,9 +94,9 @@
|
||||
</div>
|
||||
|
||||
{{if and $.CanWriteProjects (not $.Repository.IsArchived)}}
|
||||
<div class="ui small modal" id="repo-project-delete-modal">
|
||||
<dialog class="modal-dialog" id="repo-project-delete-modal">
|
||||
<div class="header">{{svg "octicon-trash"}} {{ctx.Locale.Tr "repo.projects.deletion"}}</div>
|
||||
<div class="content"><p>{{ctx.Locale.Tr "repo.projects.deletion_desc"}}</p></div>
|
||||
{{template "base/modal_actions_confirm" .}}
|
||||
</div>
|
||||
</dialog>
|
||||
{{end}}
|
||||
@@ -133,7 +133,7 @@
|
||||
</div>
|
||||
|
||||
{{if $canWriteProject}}
|
||||
<div class="ui small modal" id="project-column-modal-edit">
|
||||
<dialog class="modal-dialog" id="project-column-modal-edit">
|
||||
<div class="header">{{ctx.Locale.Tr "repo.projects.column.edit"}}</div>
|
||||
<div class="content">
|
||||
<form class="ui form ignore-dirty" method="post" data-action-base-link="{{$.Link}}">
|
||||
@@ -155,5 +155,5 @@
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</dialog>
|
||||
{{end}}
|
||||
Reference in new issue
Block a user