mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-30 18:58:45 +08:00
Keep editor background on rerender (#869)
This commit is contained in:
parent
59370a55ae
commit
35e42d1bad
2 changed files with 7 additions and 8 deletions
|
@ -45,7 +45,7 @@ const Cell = {
|
|||
editorContainer.appendChild(editorElement);
|
||||
// Adjust the background color based on local settings
|
||||
const settings = loadLocalSettings();
|
||||
editorContainer.parentElement.style.backgroundColor =
|
||||
editorContainer.style.backgroundColor =
|
||||
THEME_BACKGROUND_COLOR[settings.editor_theme];
|
||||
// Setup the editor instance.
|
||||
this.state.liveEditor = new LiveEditor(
|
||||
|
|
|
@ -212,15 +212,14 @@ defmodule LivebookWeb.SessionLive.CellComponent do
|
|||
|
||||
defp editor(assigns) do
|
||||
~H"""
|
||||
<div class="py-3 rounded-lg bg-editor relative">
|
||||
<div
|
||||
id={"editor-container-#{@cell_view.id}"}
|
||||
data-element="editor-container"
|
||||
phx-update="ignore">
|
||||
<div class="relative">
|
||||
<div id={"editor-#{@cell_view.id}"} phx-update="ignore">
|
||||
<div class="py-3 rounded-lg bg-editor" data-element="editor-container">
|
||||
<div class="px-8">
|
||||
<.content_placeholder bg_class="bg-gray-500" empty={@cell_view.empty?} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%= if @cell_view.type == :elixir do %>
|
||||
<div class="absolute bottom-2 right-2">
|
||||
|
|
Loading…
Reference in a new issue