[Jifty-commit] r773 - in jifty/trunk: share/web/static/js

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Thu Mar 30 20:47:45 EST 2006


Author: jesse
Date: Thu Mar 30 20:47:44 2006
New Revision: 773

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/share/web/static/js/rico.js

Log:
 r10632 at hualien:  jesse | 2006-03-31 10:47:25 +0900
 From Marc Beyer:
 
 Hi,
 
 loading the wifty HomePage in Konqueror (v. 3.3.2 on Debian Sarge)
 brings up a JavaScript error:
 
 http://p6:8888/static/js/rico.js: TypeError: Value undefined (result of
 expression document.attachEvent) is not an object. Cannot be called.
 
 My JavaScript knowledge is poor to nonexistant, so I have no idea
 whether this is an error in rico.js or Konqueror, but the attached patch
 (stolen shamelessly from jamest at ajrs.com at
 http://trac.openrico.org:9004/rico/ticket/2) prevents the warning.
 
 Hope that helps,
 
 Marc


Modified: jifty/trunk/share/web/static/js/rico.js
==============================================================================
--- jifty/trunk/share/web/static/js/rico.js	(original)
+++ jifty/trunk/share/web/static/js/rico.js	Thu Mar 30 20:47:44 2006
@@ -1343,9 +1343,12 @@
 	         document.addEventListener("mouseup",   this._mouseUpHandler.bindAsEventListener(this),  false);
 	         document.addEventListener("mousemove", this._mouseMoveHandler.bindAsEventListener(this), false);
 	      }
-	      else {
-	         document.attachEvent( "onmouseup",   this._mouseUpHandler.bindAsEventListener(this) );
-	         document.attachEvent( "onmousemove", this._mouseMoveHandler.bindAsEventListener(this) );
+              else if (document.attachEvent) {
+                 document.attachEvent( "onmouseup",   this._mouseUpHandler.bindAsEventListener(this) );
+                 document.attachEvent( "onmousemove", this._mouseMoveHandler.bindAsEventListener(this) );
+              } else {
+               document.onmouseup = this._mouseUpHandler.bindAsEventListener(this);
+               document.onmousemove = this._mouseMoveHandler.bindAsEventListener(this);
 	      }
 	   }
 	}


More information about the Jifty-commit mailing list