mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-13 04:00:21 +00:00
Toggle is now controlled by the browser (and don't requires a reflex)
This commit is contained in:
@@ -12,15 +12,6 @@ class SelectorComponent < ViewComponentReflex::Component
|
||||
}
|
||||
end
|
||||
@selected = selected
|
||||
@state = :close
|
||||
@data = data
|
||||
end
|
||||
|
||||
def toggle
|
||||
@state = @state == :open ? :close : :open
|
||||
end
|
||||
|
||||
def close
|
||||
@state = :close
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
= component_controller do
|
||||
.selector{ class: ("selector-close" if @state == :close) }
|
||||
.selector-main{data: reflex_data_attributes(:toggle)}
|
||||
.selector
|
||||
.selector-main{ data: { action: "click->selector#toggle" } }
|
||||
.selector-main-title
|
||||
= @title
|
||||
.selector-arrow
|
||||
|
||||
Reference in New Issue
Block a user