Only connect lightbox controller where the partial is present
- Fixes a console error that complained the dialog target was missing
This commit is contained in:
@@ -42,19 +42,19 @@
|
||||
<% end %>
|
||||
</header>
|
||||
|
||||
<div data-controller="beacon" data-beacon-url-value="<%= card_reading_url(@card) %>">
|
||||
<div data-controller="beacon lightbox" data-beacon-url-value="<%= card_reading_url(@card) %>">
|
||||
<%= render "cards/container", card: @card %>
|
||||
|
||||
<% if @card.published? || @card.drafted? %>
|
||||
<%= render "cards/messages", card: @card %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "layouts/lightbox" do %>
|
||||
<% if @card.image.attached? %>
|
||||
<%= button_to card_image_path(@card), method: :delete, class: "btn" do %>
|
||||
<%= icon_tag "trash" %>
|
||||
<span class="for-screen-reader">Remove background image</span>
|
||||
<%= render "layouts/lightbox" do %>
|
||||
<% if @card.image.attached? %>
|
||||
<%= button_to card_image_path(@card), method: :delete, class: "btn" do %>
|
||||
<%= icon_tag "trash" %>
|
||||
<span class="for-screen-reader">Remove background image</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<%= render "layouts/shared/head" %>
|
||||
|
||||
<body data-controller="lightbox local-time timezone-cookie" data-action="turbo:morph@window->local-time#refreshAll">
|
||||
<body data-controller="local-time timezone-cookie" data-action="turbo:morph@window->local-time#refreshAll">
|
||||
<header id="header">
|
||||
<a href="#main" class="skip-navigation btn" data-turbo="false">Skip to main content</a>
|
||||
<%= yield :header %>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<%= render "layouts/shared/head" %>
|
||||
|
||||
<body class="public" data-controller="lightbox local-time timezone-cookie" data-action="turbo:morph@window->local-time#refreshAll">
|
||||
<body class="public" data-controller="local-time timezone-cookie" data-action="turbo:morph@window->local-time#refreshAll">
|
||||
<header id="header">
|
||||
<a href="#main" class="skip-navigation btn" data-turbo="false">Skip to main content</a>
|
||||
<%= yield :header %>
|
||||
@@ -30,7 +30,5 @@
|
||||
<strong><a href="http://37signals.com" class="txt-ink">Made with Fizzy™</a></strong>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<%= render "layouts/lightbox" %>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
<% end %>
|
||||
|
||||
<section id="<%= dom_id(@card, :card_container) %>"
|
||||
class="card-perma card-perma--public" style="--card-color: <%= @card.color %>;">
|
||||
class="card-perma card-perma--public" data-controller="lightbox" style="--card-color: <%= @card.color %>;">
|
||||
<div class="card-perma__bg">
|
||||
<%= card_article_tag @card, class: "card" do %>
|
||||
<header class="card__header">
|
||||
@@ -45,4 +45,6 @@
|
||||
</footer>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render "layouts/lightbox" %>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user