Skip to content

Commit

Permalink
panel_collapse_trigger
Browse files Browse the repository at this point in the history
  • Loading branch information
nimmolo committed Aug 13, 2024
1 parent 94c0e9e commit 8f42c58
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions app/helpers/content_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,19 @@ def panel_block_heading(args)
end
end

def panel_collapse_trigger(args)
icon_link_to(
:OPEN.l,
"##{args[:collapse]}",
icon: link_icon(:chevron_down),
active_icon: link_icon(:chevron_up),
active_content: :CLOSE.l,
class: "panel-collapse-trigger",
role: "button", data: { toggle: "collapse" },
aria: { expanded: args[:collapsed], controls: args }
)
end

def panel_body(args, content)
return "" if content.blank?

Expand All @@ -189,13 +202,6 @@ def panel_body(args, content)
end
end

def panel_collapse_trigger(args)
link_to(link_icon(:chevron_down), "##{args[:collapse]}",
class: "panel-collapse-trigger",
role: "button", data: { toggle: "collapse" },
aria: { expanded: "false", controls: args } )
end

def panel_collapse_body(args, content)
tag.div(class: class_names("panel-collapse collapse", args[:collapsed]),
id: args[:collapse]) do
Expand Down

0 comments on commit 8f42c58

Please sign in to comment.