mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-31 03:07:53 +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);
|
editorContainer.appendChild(editorElement);
|
||||||
// Adjust the background color based on local settings
|
// Adjust the background color based on local settings
|
||||||
const settings = loadLocalSettings();
|
const settings = loadLocalSettings();
|
||||||
editorContainer.parentElement.style.backgroundColor =
|
editorContainer.style.backgroundColor =
|
||||||
THEME_BACKGROUND_COLOR[settings.editor_theme];
|
THEME_BACKGROUND_COLOR[settings.editor_theme];
|
||||||
// Setup the editor instance.
|
// Setup the editor instance.
|
||||||
this.state.liveEditor = new LiveEditor(
|
this.state.liveEditor = new LiveEditor(
|
||||||
|
|
|
@ -212,13 +212,12 @@ defmodule LivebookWeb.SessionLive.CellComponent do
|
||||||
|
|
||||||
defp editor(assigns) do
|
defp editor(assigns) do
|
||||||
~H"""
|
~H"""
|
||||||
<div class="py-3 rounded-lg bg-editor relative">
|
<div class="relative">
|
||||||
<div
|
<div id={"editor-#{@cell_view.id}"} phx-update="ignore">
|
||||||
id={"editor-container-#{@cell_view.id}"}
|
<div class="py-3 rounded-lg bg-editor" data-element="editor-container">
|
||||||
data-element="editor-container"
|
<div class="px-8">
|
||||||
phx-update="ignore">
|
<.content_placeholder bg_class="bg-gray-500" empty={@cell_view.empty?} />
|
||||||
<div class="px-8">
|
</div>
|
||||||
<.content_placeholder bg_class="bg-gray-500" empty={@cell_view.empty?} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue