r1567 + another hack
authorDenis Ovsienko <infrastation@yandex.ru>
Sat, 19 Jan 2008 20:48:49 +0000 (20:48 +0000)
committerDenis Ovsienko <infrastation@yandex.ru>
Sat, 19 Jan 2008 20:48:49 +0000 (20:48 +0000)
js/collapsible_textareas.js

index 2cac26f9a37e004b0075c0e3084151ec3bb5244b..e434082fe74ffecb90f0891eb8361ed4cbc08d47 100644 (file)
@@ -41,3 +41,24 @@ function bigSmlTextarea(e)
        else
                node.className = node.className.replace(/expanded/gi, "");
 }
+
+function setupForm (formid)
+{
+       var formArea = document.getElementById (formid);
+       var txtAreas = formArea.getElementsByTagName ("textarea");
+       for (var i=0; i<txtAreas.length; i++)
+       {
+               var thisTxtArea = txtAreas[i];
+               if (thisTxtArea.addEventListener)
+               {
+                       thisTxtArea.addEventListener("focus", bigSmlTextarea, false);
+                       thisTxtArea.addEventListener("blur", bigSmlTextarea, false);
+               }
+               else
+               { // IE
+                       thisTxtArea.attachEvent("onfocus", bigSmlTextarea);
+                       thisTxtArea.attachEvent("onblur", bigSmlTextarea);
+               }
+       }
+}
+