Commit 4e991ee2 authored by Fabien Morin's avatar Fabien Morin

check if master is not null, this may happen in some web_sites using other...

check if master is not null, this may happen in some web_sites using other templates than erp5_xhtml one and then make javascript errors.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@36975 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b506f816
...@@ -259,6 +259,7 @@ while leaving the page, unless leaving by:\n ...@@ -259,6 +259,7 @@ while leaving the page, unless leaving by:\n
*/\n */\n
var addOnChangeEventHandler = function() {\n var addOnChangeEventHandler = function() {\n
var master = document.getElementById("master");\n var master = document.getElementById("master");\n
if (master) {\n
divs = master.getElementsByTagName("div");\n divs = master.getElementsByTagName("div");\n
for (i=0; i<divs.length; i++) {\n for (i=0; i<divs.length; i++) {\n
if (divs[i].getAttribute("class") == "input") {\n if (divs[i].getAttribute("class") == "input") {\n
...@@ -300,6 +301,7 @@ var addOnChangeEventHandler = function() {\n ...@@ -300,6 +301,7 @@ var addOnChangeEventHandler = function() {\n
}\n }\n
}\n }\n
}\n }\n
}\n
}\n }\n
/* \n /* \n
* Under firefox, rewrite indented title categories using style definition.\n * Under firefox, rewrite indented title categories using style definition.\n
...@@ -307,6 +309,7 @@ var addOnChangeEventHandler = function() {\n ...@@ -307,6 +309,7 @@ var addOnChangeEventHandler = function() {\n
*/\n */\n
var rewriteIndentedSelect = function() {\n var rewriteIndentedSelect = function() {\n
var master = document.getElementById("master");\n var master = document.getElementById("master");\n
if (master){\n
selects = master.getElementsByTagName("select");\n selects = master.getElementsByTagName("select");\n
for (i=0; i<selects.length; i++) {\n for (i=0; i<selects.length; i++) {\n
options = selects[i].childNodes;\n options = selects[i].childNodes;\n
...@@ -335,6 +338,7 @@ var rewriteIndentedSelect = function() {\n ...@@ -335,6 +338,7 @@ var rewriteIndentedSelect = function() {\n
}\n }\n
}\n }\n
}\n }\n
}\n
}\n }\n
\n \n
\n \n
......
958 959
\ 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