ex_admin icon indicating copy to clipboard operation
ex_admin copied to clipboard

Adding Block Javascript to Show Page

Open cdesch opened this issue 7 years ago • 0 comments

Would adding a javascript block to the show view be fairly straightforward as dropping javascript macro onto show.ex. Or is there a reason why it is limited to the forms (form.ex)

  @doc """
  Add javascript to the form
  Adds a block of javascript code to the form. Typically used to add
  change or click handlers to elements on the page
  """
  defmacro javascript(do: block) do
    quote do
      var!(script_block, ExAdmin.Form) = unquote(block)
    end
  end

cdesch avatar Feb 05 '18 21:02 cdesch