]> dev.renevier.net Git - syj.git/commitdiff
fixes: do not activate close button on submit events
authorarno <arno@renevier.net>
Fri, 3 Sep 2010 14:27:09 +0000 (16:27 +0200)
committerarno <arno@renevier.net>
Fri, 3 Sep 2010 14:27:09 +0000 (16:27 +0200)
public/js/utils.js

index 4c53c76d07cadf7a183b797e52cf8b68f9e5384e..aba7b1d1f7aa6ebd91187612b4afba17af77bbd2 100644 (file)
@@ -26,6 +26,9 @@ var CloseBtn = Class.create({
         elt.insert({top: btn});
         btn.observe("click", function(evt) {
             evt.stop();
+            if (evt.detail === 0) { // it's not a real click, possibly a submit event
+                return;
+            }
             if (typeof options.callback === "function") {
                 options.callback.call(elt);
             }