Skip to content

Commit 6e688b2

Browse files
committed
Allow dialogues to be closed by "clicking outside"
1 parent 92e87cc commit 6e688b2

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

app/views/application/_flash.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
}
88
</style>
99

10-
<dialog class="bottom-0 w-full bg-transparent" <%= "open" if flash[:notice] %>>
10+
<dialog closedBy="any" class="bottom-0 w-full bg-transparent" <%= "open" if flash[:notice] %>>
1111
<div
1212
class="flex bg-white shadow rounded opacity-0 -bottom-20 left-8 fixed p-3 items-center justify-between"
1313
style="animation: flash 10s; animation-iteration-count: 1;"
@@ -20,7 +20,7 @@
2020
</div>
2121
</dialog>
2222

23-
<dialog class="bottom-0 w-full bg-transparent" <%= "open" if flash[:alert] %>>
23+
<dialog closedBy="any" class="bottom-0 w-full bg-transparent" <%= "open" if flash[:alert] %>>
2424
<div
2525
class="flex bg-white shadow rounded opacity-0 -bottom-20 left-8 fixed p-3 items-center justify-between"
2626
style="animation: flash 10s; animation-iteration-count: 1;"

app/views/servers/prepare_bootstrap.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= turbo_frame_tag "servers-actions-dialog" do %>
2-
<dialog id="server-actions-dialog" class="max-w-[60rem] backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
2+
<dialog closedBy="any" id="server-actions-dialog" class="max-w-[60rem] backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
33
<form method="dialog" class="flex mb-4">
44
<h2 class="text-2xl mr-5">Bootstrap server: <%= @server.name %></h2>
55
<button class="ml-auto text-gray-500 hover:text-gray-700"><%= icon_close %></button>

app/views/servers/reboot_command.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= turbo_frame_tag "servers-actions-dialog" do %>
2-
<dialog id="server-actions-dialog" class="backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
2+
<dialog closedBy="any" id="server-actions-dialog" class="backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
33
<form method="dialog" class="flex mb-4">
44
<h2 class="text-2xl">Reboot Command</h2>
55
<button class="ml-auto text-gray-500 hover:text-gray-700"><%= icon_close %></button>

app/views/servers/upgrade_command.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<%= turbo_frame_tag "servers-actions-dialog" do %>
2-
<dialog id="server-actions-dialog" class="max-w-[60rem] backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
2+
<dialog closedBy="any" id="server-actions-dialog" class="max-w-[60rem] backdrop:backdrop-blur-sm backdrop:bg-gray-100 backdrop:bg-opacity-30 p-6 rounded-lg shadow-lg">
33
<form method="dialog" class="flex mb-4">
44
<h2 class="text-2xl">Upgrade Command</h2>
55
<button class="ml-auto text-gray-500 hover:text-gray-700"><%= icon_close %></button>

0 commit comments

Comments
 (0)