Commit 83906856 authored by Yoshinori Okuji's avatar Yoshinori Okuji

2008-04-11 yo

* Disable auto focus for forms which do not have an element with the autofocus class.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20456 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ba5e04fd
No related merge requests found
...@@ -74,8 +74,8 @@ function clickSaveButton(act) {\n ...@@ -74,8 +74,8 @@ function clickSaveButton(act) {\n
\n \n
\n \n
// The first input element with an "autofocus" class will get the focus,\n // The first input element with an "autofocus" class will get the focus,\n
// else if no element have autofocus class, the first element wich is not the\n // else if no element have autofocus class, the first element which is not the\n
// search field will get the focus. This is generaly the title input text of\n // search field will get the focus. This is generally the title input text of\n
// a view\n // a view\n
function autoFocus() {\n function autoFocus() {\n
var first_autofocus_expr = ".//input[@class=\'autofocus\']"\n var first_autofocus_expr = ".//input[@class=\'autofocus\']"\n
...@@ -85,11 +85,12 @@ function autoFocus() {\n ...@@ -85,11 +85,12 @@ function autoFocus() {\n
if (input) {\n if (input) {\n
input.focus();\n input.focus();\n
}else{\n }else{\n
var first_text_input_expr = ".//input[@type=\'text\'][@name != \'field_your_search_text\']"\n // The following is disabled, because it is too annoying to have an auto focus at everywhere.\n
var first_text_input = document.evaluate(first_text_input_expr, document, null, FIRST_RESULT, null).singleNodeValue;\n //var first_text_input_expr = ".//input[@type=\'text\'][@name != \'field_your_search_text\']"\n
if (first_text_input){\n //var first_text_input = document.evaluate(first_text_input_expr, document, null, FIRST_RESULT, null).singleNodeValue;\n
first_text_input.focus();\n //if (first_text_input){\n
}\n // first_text_input.focus();\n
//}\n
}\n }\n
}\n }\n
\n \n
......
2008-04-11 yo
* Disable auto focus for forms which do not have an element with the autofocus class.
2008-03-27 ivan 2008-03-27 ivan
* Update MochiKit JS library to 1.4 * Update MochiKit JS library to 1.4
......
523 524
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment