r3009 committed - Accordion: Don't stop propagation when clicking in headers. Fixes #47...

r3009 committed - Accordion: Don't stop propagation when clicking in headers. Fixes #47...


Revision: 3009
Author: scott.gonzalez
Date: Thu Jul 30 17:23:41 2009
Log: Accordion: Don't stop propagation when clicking in headers. Fixes
#4732 - accordion steals header clicks.
http://code.google.com/p/jquery-ui/source/detail?r=3009
Modified:
/trunk/ui/ui.accordion.js
=======================================
--- /trunk/ui/ui.accordion.js    Wed Jul 15 01:32:22 2009
+++ /trunk/ui/ui.accordion.js    Thu Jul 30 17:23:41 2009
@@ -101,7 +101,10 @@
            this.headers.find('a').attr('tabIndex','-1');
        if (o.event) {
-            this.headers.bind((o.event) + ".accordion", function(event) { return
self._clickHandler.call(self, event, this); });
+            this.headers.bind((o.event) + ".accordion", function(event) {
+                self._clickHandler.call(self, event, this);
+                event.preventDefault();
+            });
        }
    },
@@ -181,7 +184,8 @@
                break;
            case keyCode.SPACE:
            case keyCode.ENTER:
-                return this._clickHandler({ target: event.target }, event.target);
+                this._clickHandler({ target: event.target }, event.target);
+                event.preventDefault();
        }
        if (toFocus) {
@@ -246,7 +250,7 @@
    _clickHandler: function(event, target) {
        var o = this.options;
-        if (o.disabled) return false;
+        if (o.disabled) { return; }
        // called only when using activate(false) to close all parts
programmatically
        if (!event.target && o.collapsible) {
@@ -263,7 +267,7 @@
                },
                toShow = (this.active = $([]));
            this._toggle(toShow, toHide, data);
-            return false;
+            return;
        }
        // get the click target
@@ -272,7 +276,7 @@
        // if animations are still active, or the active header is the target,
ignore click
        if (this.running || (!o.collapsible && clickedIsActive)) {
-            return false;
+            return;
        }
        // switch classes
@@ -299,7 +303,7 @@
        this.active = clickedIsActive ? $([]) : clicked;
        this._toggle(toShow, toHide, data, clickedIsActive, down);
-        return false;
+        return;
    },