diff --git a/app/helpers/content_helper.rb b/app/helpers/content_helper.rb index cf63f18e95..0150e1c7c5 100644 --- a/app/helpers/content_helper.rb +++ b/app/helpers/content_helper.rb @@ -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? @@ -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