Sha256: 027ca39ec20e2bd21c9280c212f87edf83213bf113206e5958d1e5c5d9ce6a6e
Contents?: true
Size: 969 Bytes
Versions: 4
Compression:
Stored size: 969 Bytes
Contents
<% # formstrap/shared/popup # # ==== Options # * +id</tt> - Identifier for this popup # # ==== Examples # To trigger this popup create an element with a data attribute like this # # <button data-popup-id="popupId">open Popup</button> # <%= render "formstrap/shared/popup", id: "popupId" do %#> # popup Content # <% end %#> # # If you want to pass a click event to an element inside the popup without opening the popup you can use the # "data-popup-pass-thru" attribute. # # <button data-popup-id="popupId" data-popup-pass-thru="#link">open Popup</button> # <%= render "formstrap/shared/popup", id: "popupId" do %#> # <a href="https://example.com" id="link"> # <% end %#> data = local_assigns.has_key?(:data) ? data : {} options = { class: ["h-popup", "closed"], data: data.merge("popup-target": "popup", "popup-id": id) } %> <%= content_tag(:div, options) do %> <%= yield %> <% end %>
Version data entries
4 entries across 4 versions & 1 rubygems