]> dev.renevier.net Git - syj.git/blobdiff - public/js/utils.js
some jslint cleanup
[syj.git] / public / js / utils.js
index f5817d491a2087f3198089e5dad1d0d77bc87a18..588a85b590e2af6303225f47b478b7c62ce1837f 100644 (file)
@@ -21,6 +21,10 @@ var CloseBtn = Class.create({
         btn = new Element("input", { type: "image", src: imgsrc, alt: "X"}).setStyle(style);
         elt.insert({top: btn});
         btn.observe("click", function(evt) {
+            evt.stop();
+            if (typeof options.callback === "function") {
+                options.callback.call(elt);
+            }
             elt.hide();
         });
     }
@@ -115,12 +119,12 @@ Ajax.TimedRequest = Class.create(Ajax.Request, {
     },
 
     request: function($super, url) {
-        this.timeout = (function() {
+        this.timeout = function() {
             if (this.options.onFailure) {
                 this.options.onFailure(null);
             }
             this.abort();
-        }).bind(this).delay(this.delay);
+        }.bind(this).delay(this.delay);
         $super(url);
     }
 });
@@ -186,7 +190,7 @@ Element.addMethods('form', {
         });
     },
 
-    focus: function(form) {
+    setfocus: function(form) {
         var tofocus, error;
 
         tofocus = null;