diff --git a/assets/app/hooks/fullscreen.js b/assets/app/hooks/fullscreen.js index 2a1d4007a..ae7fef9a6 100644 --- a/assets/app/hooks/fullscreen.js +++ b/assets/app/hooks/fullscreen.js @@ -10,7 +10,10 @@ const Fullscreen = { this.el.close(); this.el.classList.remove('flex'); this.el.classList.add('hidden'); - this.pushEvent('fullscreen-closed', { id: this.el.id }); + + if (this.el.hasAttribute('data-send-close-event')) { + this.pushEvent('fullscreen-closed', { id: this.el.id }); + } }; // Events from the browser diff --git a/lib/live_debugger/app/debugger/node_state/web/hook_components/assigns_history.ex b/lib/live_debugger/app/debugger/node_state/web/hook_components/assigns_history.ex index 6757f98ea..f7fb328ac 100644 --- a/lib/live_debugger/app/debugger/node_state/web/hook_components/assigns_history.ex +++ b/lib/live_debugger/app/debugger/node_state/web/hook_components/assigns_history.ex @@ -41,7 +41,7 @@ defmodule LiveDebugger.App.Debugger.NodeState.Web.HookComponents.AssignsHistory assigns = assign(assigns, id: @assigns_history_id) ~H""" - <.fullscreen id={@id} title="Assigns History" class="xl:w-3/4!"> + <.fullscreen id={@id} title="Assigns History" send_close_event={true} class="xl:w-3/4!">
<.async_result :let={history_entries} assign={@history_entries}> <:loading> diff --git a/lib/live_debugger/app/web/components.ex b/lib/live_debugger/app/web/components.ex index 349167d72..c14581847 100644 --- a/lib/live_debugger/app/web/components.ex +++ b/lib/live_debugger/app/web/components.ex @@ -470,6 +470,12 @@ defmodule LiveDebugger.App.Web.Components do attr(:id, :string, required: true) attr(:title, :string, default: "", doc: "Title of the fullscreen.") + attr(:send_close_event, :boolean, + default: false, + doc: + "Whether to send a `fullscreen-closed` event to the server when the fullscreen is closed." + ) + attr(:class, :any, default: nil, doc: "Additional classes to be added to the fullscreen element." @@ -483,6 +489,7 @@ defmodule LiveDebugger.App.Web.Components do