[Jifty-commit] r4706 - jifty/branches/jquery/share/web/static/js

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat Dec 15 08:19:18 EST 2007


Author: gugod
Date: Sat Dec 15 08:19:17 2007
New Revision: 4706

Modified:
   jifty/branches/jquery/share/web/static/js/jifty.js

Log:
This replace Event.observe with jQuery's bind() method.


Modified: jifty/branches/jquery/share/web/static/js/jifty.js
==============================================================================
--- jifty/branches/jquery/share/web/static/js/jifty.js	(original)
+++ jifty/branches/jquery/share/web/static/js/jifty.js	Sat Dec 15 08:19:17 2007
@@ -1359,7 +1359,10 @@
     this.action = Form.Element.getAction(this.field);
     this.url    = '/__jifty/autocomplete.xml';
 
-    Event.observe(this.field, "focus", this.onFocus.bindAsEventListener(this));
+    jQuery(this.field).bind("focus", function(event) {
+        self.onFocus(event);
+    });
+      
     this.baseInitialize(this.field, $(div), {
         minChars: "0",
         beforeShow: this.beforeShow,
@@ -1452,8 +1455,18 @@
   initialize: function(element, text) {
      this.element = $(element);
      this.text = text;
-     Event.observe(element, 'focus', this.onFocus.bind(this));
-     Event.observe(element, 'blur', this.onBlur.bind(this));
+
+     var self = this;
+
+     jQuery(element)
+     .bind("focus", function(event) {
+         self.onFocus();
+     })
+     .bind("blur", function(event) {
+         self.onBlur();
+     });
+
+      
      this.onBlur();
 
      var form = Form.Element.getForm(element);


More information about the Jifty-commit mailing list