Module: check_mk
Branch: master
Commit: 69cde2121fa75d1b3c213446727e020f2ba2cd0c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=69cde2121fa75d…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 3 14:24:07 2016 +0100
Set focus to title, not to ID when creating new page types
---
web/htdocs/forms.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 0256951..81fdcd7 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -188,7 +188,10 @@ def edit_valuespec(vs, value, buttontext=None,
method="GET", varprefix="",
html.button("save", buttontext)
html.del_var("filled_in") # Should be ignored be hidden_fields, but I do
not dare to change it there
html.hidden_fields()
- vs.set_focus(varprefix)
+ if focus:
+ html.set_focus(focus)
+ else:
+ vs.set_focus(varprefix)
html.end_form()
# New functions for painting forms