Files
fizzy/app/helpers/columns_helper.rb
T
Jorge Manrubia 8c8dbe888e Fix assorted issues when reloading pages with morphing and the pagination system
This patches 2 problems in Turbo/idiomorph that are causing problems when reloading the pagination frames:

- No remove callback in idiomorph when removing a node that had been mapped.
- Regression introduced by https://github.com/hotwired/turbo/pull/1311, where it won't prevent the removal of frames with refresh=morph

I will upstream both patches, this is temporary.

https://fizzy.37signals.com/5986089/cards/2291
2025-10-16 13:39:16 +02:00

21 lines
786 B
Ruby

module ColumnsHelper
def button_to_set_column(card, column)
button_to \
tag.span(column.name, class: "overflow-ellipsis"),
card_triage_path(card, column_id: column),
method: :post,
class: [ "card__column-name btn", { "card__column-name--current": column == card.column } ],
form_class: "flex align-center gap-half",
data: { turbo_frame: "_top" }
end
def column_frame_tag(id, src: nil, data: {}, **options, &block)
data = data.reverse_merge \
"drag-and-drop-refresh": true,
controller: "frame",
action: "turbo:before-frame-render->frame#morphRender turbo:before-morph-element->frame#morphReload"
options[:refresh] = :morph if src.present?
turbo_frame_tag(id, src: src, data: data, **options, &block)
end
end