mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-10-09 13:07:37 +08:00
adding a disabled delete button for sections that have branches (#624)
* adding a disabled delete button for sections that have branches * Apply suggestions from code review * Update assets/css/components.css * Apply suggestions from code review Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
This commit is contained in:
parent
93e9b06a29
commit
f6d31a7d86
2 changed files with 8 additions and 9 deletions
|
@ -61,7 +61,8 @@
|
||||||
@apply bg-gray-100;
|
@apply bg-gray-100;
|
||||||
}
|
}
|
||||||
|
|
||||||
.icon-button:disabled {
|
.icon-button:disabled,
|
||||||
|
.icon-button.disabled {
|
||||||
@apply cursor-default pointer-events-none text-gray-300;
|
@apply cursor-default pointer-events-none text-gray-300;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,14 +68,12 @@ defmodule LivebookWeb.SessionLive.SectionComponent do
|
||||||
<.remix_icon icon="arrow-down-s-line" class="text-xl" />
|
<.remix_icon icon="arrow-down-s-line" class="text-xl" />
|
||||||
</button>
|
</button>
|
||||||
</span>
|
</span>
|
||||||
<%= unless @section_view.has_children? do %>
|
<span class="tooltip top" aria-label={if @section_view.has_children?, do: "Cannot delete this section because\nother sections branch from it", else: "Delete"}>
|
||||||
<span class="tooltip top" aria-label="Delete">
|
|
||||||
<%= live_patch to: Routes.session_path(@socket, :delete_section, @session_id, @section_view.id),
|
<%= live_patch to: Routes.session_path(@socket, :delete_section, @session_id, @section_view.id),
|
||||||
class: "icon-button" do %>
|
class: "icon-button #{if @section_view.has_children?, do: "disabled"}" do %>
|
||||||
<.remix_icon icon="delete-bin-6-line" class="text-xl" />
|
<.remix_icon icon="delete-bin-6-line" class="text-xl" />
|
||||||
<% end %>
|
<% end %>
|
||||||
</span>
|
</span>
|
||||||
<% end %>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<%= if @section_view.parent do %>
|
<%= if @section_view.parent do %>
|
||||||
|
|
Loading…
Add table
Reference in a new issue