Skip to content

Commit

Permalink
js: hightlight dirty nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
sorax committed May 14, 2024
1 parent d2d24d8 commit a19f84d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion assets/js/hooks/item.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function createItem({ uuid, content, parent_id, prev_id, dirty }: Node) {

const item = document.createElement("li");
item.id = "outline-node-" + uuid;
item.className = "my-1 ml-4";
item.className = dirty ? "my-1 ml-4 bg-red-100" : "my-1 ml-4";

item.setAttribute("data-parent", parent_id || "");
item.setAttribute("data-prev", prev_id || "");
Expand All @@ -32,6 +32,8 @@ export function updateItem(
const input = item.firstChild!;
input.textContent = content;

item.className = dirty ? "my-1 ml-4 bg-red-100" : "my-1 ml-4";

item.setAttribute("data-parent", parent_id || "");
item.setAttribute("data-prev", prev_id || "");
item.setAttribute("data-dirty", dirty ? "true" : "false");
Expand Down
2 changes: 1 addition & 1 deletion test/radiator_web/live/episode_live_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule RadiatorWeb.EpisodeLiveTest do
import Radiator.PodcastFixtures
import Radiator.OutlineFixtures

alias Radiator.Outline.Node
# alias Radiator.Outline.Node
alias Radiator.Outline.NodeRepository

describe "Episode page is restricted" do
Expand Down

0 comments on commit a19f84d

Please sign in to comment.