ie textarea fixes
authorGabriel Wicke <gwicke@users.mediawiki.org>
Mon, 19 Apr 2004 14:12:51 +0000 (14:12 +0000)
committerGabriel Wicke <gwicke@users.mediawiki.org>
Mon, 19 Apr 2004 14:12:51 +0000 (14:12 +0000)
stylesheets/IEFixes.js

index 25991cc..a9a7428 100644 (file)
@@ -1,13 +1,20 @@
 // IE fix javascript
+var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
+if (rslt != null ) var version = Number(rslt[1]);
+else var version = 0;
 
-// png alpha transparency fixes
-window.attachEvent("onload", fixalpha);
+window.attachEvent("onload", hookit);
+function hookit() {
+    fixalpha();
+    fixtextarea();
+    var wrapper = document.getElementById('tawrapper');
+    if(wrapper) wrapper.attachEvent("onclick", fixtextarea);
+}
 
+// png alpha transparency fixes
 function fixalpha(){
     // bg
-    var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
-    if (rslt != null && Number(rslt[1]) >= 5.5)
-    {
+    if(version >= 5.5) {
         var logoa = document.getElementById('portlet-logo').firstChild;
         var bg = logoa.currentStyle.backgroundImage;
         if (bg.match(/\.png/i) != null){
@@ -35,3 +42,11 @@ function fixalpha(){
         }*/
     }
 }
+
+function fixtextarea() {
+    var wrapper = document.getElementById('tawrapper');
+    if(wrapper) {
+            wrapper.style.width = 'auto';
+            wrapper.style.width = (wrapper.offsetWidth - 4)  + 'px';
+    }
+}