Fix dtext preview button to use event delegation.
Fixes the dtext preview button and dtext expandable to work with dynamically loaded dtext forms.
This commit is contained in:
@@ -181,10 +181,8 @@ module ApplicationHelper
|
||||
render "dtext/form", options
|
||||
end
|
||||
|
||||
def dtext_preview_button(object, name, options = {})
|
||||
options[:input_id] ||= "#{object}_#{name}"
|
||||
options[:preview_id] ||= "dtext-preview"
|
||||
submit_tag("Preview", "data-input-id" => options[:input_id], "data-preview-id" => options[:preview_id])
|
||||
def dtext_preview_button(object, name, input_id: "#{object}_#{name}", preview_id: "dtext-preview")
|
||||
tag.input value: "Preview", type: "button", class: "dtext-preview-button", "data-input-id": input_id, "data-preview-id": preview_id
|
||||
end
|
||||
|
||||
def search_field(method, label: method.titleize, hint: nil, value: nil, **attributes)
|
||||
|
||||
Reference in New Issue
Block a user