Sha256: f98c926dc4f624a431502e62835bd9ac9b675df0403f1f19da267eeb1f56df9c

Contents?: true

Size: 1003 Bytes

Versions: 7

Compression:

Stored size: 1003 Bytes

Contents

<%#
  Generic partial for placing a button that will load popup content in a modal via Shoelace.
  Required params:
    - frame_id (the DOM ID of the turbo frame)

  Optional class:
    - src (the URL to load popup content from)
    - container_class (class attribute of the wrapper div. Defaults to "refine--inline-popup-container")
    - frame_class (class attribute of the turbo frame. Defaults to "refine--inline-popup")

  somewhere in your yield be sure to include a `data-action="click->refine--popup#show"` to trigger the the popup

  Popup can be hidden with `data-action="click->refine--popup#hide"`
%>

<%
  src ||= ""
  container_class ||= "sl-dialog refine--inline-modal-container"
  frame_class ||= "refine--inline-modal"
  is_open ||= false

%>

<%= tag.div data: {controller: "refine--modal", refine__modal_src_value: src, refine__modal_is_open_value: is_open } do %>
  <%= yield %>

  <%= turbo_frame_tag frame_id, class: frame_class, data: {refine__modal_target: "frame"} %>
<% end %>

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
refine-rails-2.12.0 app/views/refine/advanced_inline/filters/_modal.html.erb
refine-rails-2.11.12 app/views/refine/advanced_inline/filters/_modal.html.erb
refine-rails-2.11.11 app/views/refine/advanced_inline/filters/_modal.html.erb
refine-rails-2.11.10 app/views/refine/advanced_inline/filters/_modal.html.erb
refine-rails-2.11.9 app/views/refine/advanced_inline/filters/_modal.html.erb
refine-rails-2.11.8 app/views/refine/inline/filters/_modal.html.erb
refine-rails-2.11.6 app/views/refine/inline/filters/_modal.html.erb