Skip to content

Commit

Permalink
Add Advanced config to remove autofocus on firt input
Browse files Browse the repository at this point in the history
  • Loading branch information
yurj committed Dec 9, 2024
1 parent 27a8ccd commit 0fef703
Show file tree
Hide file tree
Showing 13 changed files with 2,553 additions and 2,442 deletions.
4 changes: 4 additions & 0 deletions src/collective/easyform/browser/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ def action(self):
def enable_form_tabbing(self):
return self.context.form_tabbing

@property
def enable_autofocus(self):
return self.context.autofocus

@property
def enable_unload_protection(self):
return self.context.unload_protection
Expand Down
8 changes: 8 additions & 0 deletions src/collective/easyform/interfaces/easyform.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ class IEasyForm(Schema):
"useCancelButton",
"resetLabel",
"form_tabbing",
"autofocus",
"nameAttribute",
"default_fieldset_label",
"method",
Expand Down Expand Up @@ -242,6 +243,13 @@ class IEasyForm(Schema):
default=True,
required=False,
)
directives.write_permission(autofocus=config.EDIT_ADVANCED_PERMISSION)
autofocus = zope.schema.Bool(
title=_(u"label_autofocus", default=u"Enable focus on the first input"),
description=_(u"help_autofocus", default=u""),
default=True,
required=False,
)
directives.write_permission(default_fieldset_label=config.EDIT_ADVANCED_PERMISSION)
default_fieldset_label = zope.schema.TextLine(
title=_(
Expand Down
Loading

0 comments on commit 0fef703

Please sign in to comment.