mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Fix bulk editing
This commit is contained in:
parent
2000f05453
commit
2e0794b8e1
1 changed files with 7 additions and 2 deletions
|
@ -43,21 +43,26 @@ class DialogComponent < ViewComponent::Base
|
|||
full: "lg:max-w-full"
|
||||
}.freeze
|
||||
|
||||
def initialize(variant: "modal", auto_open: true, reload_on_close: false, width: "md", disable_frame: false, **opts)
|
||||
def initialize(variant: "modal", auto_open: true, reload_on_close: false, width: "md", frame: nil, disable_frame: false, **opts)
|
||||
@variant = variant.to_sym
|
||||
@auto_open = auto_open
|
||||
@reload_on_close = reload_on_close
|
||||
@width = width.to_sym
|
||||
@frame = frame
|
||||
@disable_frame = disable_frame
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
def frame
|
||||
@frame || variant
|
||||
end
|
||||
|
||||
# Caller must "opt-out" of using the default turbo-frame based on the variant
|
||||
def wrapper_element(&block)
|
||||
if disable_frame
|
||||
content_tag(:div, &block)
|
||||
else
|
||||
content_tag("turbo-frame", id: variant, &block)
|
||||
content_tag("turbo-frame", id: frame, &block)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue