fix closing modal without triggering reload

This commit is contained in:
shibao 2022-02-20 15:00:53 -05:00
parent aa08e212ee
commit 9f784c3190

View File

@ -44,22 +44,18 @@ defmodule CanneryWeb.LiveHelpers do
w-full h-full overflow-hidden w-full h-full overflow-hidden
p-8 flex flex-col justify-center items-center" p-8 flex flex-col justify-center items-center"
style="opacity: 1 !important; background-color: rgba(0,0,0,0.4);" style="opacity: 1 !important; background-color: rgba(0,0,0,0.4);"
phx-remove={hide_modal()}
> >
<div <div
id="modal-content" id="modal-content"
class="fade-in-scale w-full max-w-3xl max-h-128 relative overflow-y-auto class="fade-in-scale w-full max-w-3xl max-h-128 relative overflow-y-auto
flex flex-col justify-start items-center flex flex-col justify-start items-center
bg-white border-2 rounded-lg" bg-white border-2 rounded-lg"
phx-click-away={hide_modal()}
phx-window-keydown={hide_modal()}
phx-key="escape"
> >
<%= live_patch to: @return_to, <%= live_patch to: @return_to,
id: "close", id: "close",
class: class:
"absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out", "absolute top-8 right-10 text-gray-500 hover:text-gray-800 transition-all duration-500 ease-in-out"
phx_click: hide_modal() do %> do %>
<i class="fa-fw fa-lg fas fa-times"></i> <i class="fa-fw fa-lg fas fa-times"></i>
<% end %> <% end %>