From cc2820f17e06a868baab095c0939bc0385dff24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Mon, 26 Apr 2021 15:24:43 +0200 Subject: [PATCH] Add anchor links to sections (#243) --- lib/livebook_web/live/session_live/cell_component.ex | 8 +++----- .../live/session_live/section_component.ex | 10 +++++++++- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/livebook_web/live/session_live/cell_component.ex b/lib/livebook_web/live/session_live/cell_component.ex index aad8cb9f7..b57a73c43 100644 --- a/lib/livebook_web/live/session_live/cell_component.ex +++ b/lib/livebook_web/live/session_live/cell_component.ex @@ -19,7 +19,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do ~L"""
- <%= render_cell_anchor_link(@cell_view) %> + <%= render_cell_anchor_link(assigns) %>
- <%= render_cell_anchor_link(@cell_view) %> + <%= render_cell_anchor_link(assigns) %> <%= live_patch to: Routes.session_path(@socket, :cell_settings, @session_id, @cell_view.id), class: "icon-button" do %> <%= remix_icon("list-settings-line", class: "text-xl") %> @@ -165,9 +165,7 @@ defmodule LivebookWeb.SessionLive.CellComponent do """ end - defp render_cell_anchor_link(cell_view) do - assigns = %{cell_view: cell_view} - + defp render_cell_anchor_link(assigns) do ~L""" diff --git a/lib/livebook_web/live/session_live/section_component.ex b/lib/livebook_web/live/session_live/section_component.ex index 3d972c87c..097371d90 100644 --- a/lib/livebook_web/live/session_live/section_component.ex +++ b/lib/livebook_web/live/session_live/section_component.ex @@ -3,7 +3,10 @@ defmodule LivebookWeb.SessionLive.SectionComponent do def render(assigns) do ~L""" -