Class: UltimateTurboModal::Base
Instance Method Summary
collapse
-
#footer(&block) ⇒ Object
-
#initialize(advance: UltimateTurboModal.configuration.advance, allowed_click_outside_selector: UltimateTurboModal.configuration.allowed_click_outside_selector, close_button: UltimateTurboModal.configuration.close_button, close_button_data_action: "modal#hideModal", close_button_sr_label: "Close modal", footer_divider: UltimateTurboModal.configuration.footer_divider, header: UltimateTurboModal.configuration.header, header_divider: UltimateTurboModal.configuration.header_divider, padding: UltimateTurboModal.configuration.padding, content_div_data: nil, request: nil, title: nil) ⇒ Base
constructor
-
#template(&block) ⇒ Object
-
#title(&block) ⇒ Object
Constructor Details
#initialize(advance: UltimateTurboModal.configuration.advance, allowed_click_outside_selector: UltimateTurboModal.configuration.allowed_click_outside_selector, close_button: UltimateTurboModal.configuration.close_button, close_button_data_action: "modal#hideModal", close_button_sr_label: "Close modal", footer_divider: UltimateTurboModal.configuration.footer_divider, header: UltimateTurboModal.configuration.header, header_divider: UltimateTurboModal.configuration.header_divider, padding: UltimateTurboModal.configuration.padding, content_div_data: nil, request: nil, title: nil) ⇒ Base
Returns a new instance of Base.
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'lib/ultimate_turbo_modal/base.rb', line 16
def initialize(
advance: UltimateTurboModal.configuration.advance,
allowed_click_outside_selector: UltimateTurboModal.configuration.allowed_click_outside_selector,
close_button: UltimateTurboModal.configuration.close_button,
close_button_data_action: "modal#hideModal",
close_button_sr_label: "Close modal",
footer_divider: UltimateTurboModal.configuration.,
header: UltimateTurboModal.configuration.,
header_divider: UltimateTurboModal.configuration.,
padding: UltimateTurboModal.configuration.padding,
content_div_data: nil,
request: nil, title: nil
)
@advance = !!advance
@advance_url = advance if advance.present? && advance.is_a?(String)
@allowed_click_outside_selector = allowed_click_outside_selector
@close_button = close_button
@close_button_data_action = close_button_data_action
@close_button_sr_label = close_button_sr_label
@footer_divider =
@header =
@header_divider =
@padding = padding
@content_div_data = content_div_data
@request = request
@title = title
unless self.class.include?(Turbo::FramesHelper)
self.class.include Turbo::FramesHelper
self.class.include Turbo::StreamsHelper
self.class.include Phlex::Rails::Helpers::ContentTag
self.class.include Phlex::Rails::Helpers::Routes
self.class.include Phlex::Rails::Helpers::Tag
end
end
|
Instance Method Details
70
71
72
|
# File 'lib/ultimate_turbo_modal/base.rb', line 70
def (&block)
@footer = block
end
|
#template(&block) ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/ultimate_turbo_modal/base.rb', line 52
def template(&block)
if turbo_frame?
turbo_frame_tag("modal") do
modal(&block)
end
elsif turbo_stream?
Turbo::StreamsHelper.turbo_stream_action_tag("update", target: "modal") do
modal(&block)
end
else
render block
end
end
|
#title(&block) ⇒ Object
66
67
68
|
# File 'lib/ultimate_turbo_modal/base.rb', line 66
def title(&block)
@title_block = block
end
|