From f8cdb3ae897432d29503bf2b2a04f49972e4bff3 Mon Sep 17 00:00:00 2001 From: Fabien Morin <fabien@nexedi.com> Date: Mon, 17 Mar 2008 22:57:49 +0000 Subject: [PATCH] 2008-03-18 fabien * change the autoFocus() function of the erp5.js file to give the focus to the first text input of the view. This permit to have the focus on the title when create a new object. * correct my last changelog, the date was not the good. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19978 20353a03-c40f-0410-a6d1-a30d3c3de9de --- .../portal_skins/erp5_xhtml_style/erp5.js.xml | 22 +++++++++++++------ .../bootstrap/erp5_xhtml_style/bt/change_log | 5 ++++- .../bootstrap/erp5_xhtml_style/bt/revision | 2 +- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml index e12183bb7b..5fa02e81db 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml +++ b/product/ERP5/bootstrap/erp5_xhtml_style/SkinTemplateItem/portal_skins/erp5_xhtml_style/erp5.js.xml @@ -3,11 +3,8 @@ <record id="1" aka="AAAAAAAAAAE="> <pickle> <tuple> - <tuple> - <string>OFS.DTMLMethod</string> - <string>DTMLMethod</string> - </tuple> - <none/> + <global name="DTMLMethod" module="OFS.DTMLMethod"/> + <tuple/> </tuple> </pickle> <pickle> @@ -77,7 +74,10 @@ function clickSaveButton(act) {\n \n \n // The first input element with an "autofocus" class will get the focus,\n -// else, nothing done\n +// else if no element have autofocus class, the first element wich is not the\n +// search field will get the focus. This is generaly the title input text of\n +// a view\n +\n function autoFocus() {\n var inputs = document.getElementsByTagName("input");\n var input_to_focus = 0;\n @@ -88,6 +88,13 @@ function autoFocus() {\n }\n if (input_to_focus != 0) {\n input_to_focus.focus();\n + }else{\n + for ( var i=0; i<inputs.length; i++ ){\n + if (inputs[i].getAttribute("type") == "text" && inputs[i].getAttribute("name") != "field_your_search_text"){\n + inputs[i].focus();\n + break;\n + }\n + }\n }\n }\n \n @@ -132,7 +139,8 @@ function fixLeftRightHeightAndFocus(fix_height) {\n fixLeftRightHeight();\n }\n autoFocus();\n -} +}\n + ]]></string> </value> </item> diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log index ea3e8fc131..da1d0fab5d 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/change_log @@ -1,4 +1,7 @@ -2008-03-06 fabien +2008-03-18 fabien +* change the autoFocus() function of the erp5.js file to give the focus to the first text input of the view. + +2008-03-17 fabien * Add new selector for matrixbox style attribute wich were hardcoded (and not valid) before r19976. 2008-03-06 jerome diff --git a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision index 430faa64e7..54a584dece 100644 --- a/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision +++ b/product/ERP5/bootstrap/erp5_xhtml_style/bt/revision @@ -1 +1 @@ -511 \ No newline at end of file +514 \ No newline at end of file -- 2.30.9