fix(carte): no autosave on champ carte
This commit is contained in:
parent
ad9f072246
commit
6945b3f438
4 changed files with 23 additions and 7 deletions
|
@ -30,7 +30,7 @@ class EditableChamp::EditableChampComponent < ApplicationComponent
|
|||
end
|
||||
|
||||
def stimulus_controller
|
||||
if !@champ.block? && @champ.fillable?
|
||||
if autosave_enabled?
|
||||
# This is an editable champ. Lets find what controllers it might need.
|
||||
controllers = ['autosave']
|
||||
|
||||
|
@ -45,4 +45,8 @@ class EditableChamp::EditableChampComponent < ApplicationComponent
|
|||
{}
|
||||
end
|
||||
end
|
||||
|
||||
def autosave_enabled?
|
||||
!@champ.carte? && !@champ.block? && @champ.fillable?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue