diff options
| author | fat <[email protected]> | 2014-07-21 22:44:35 -0700 |
|---|---|---|
| committer | fat <[email protected]> | 2014-07-21 22:44:35 -0700 |
| commit | 4775c9296ab95b49fc1e4b0f86d1db26176013ef (patch) | |
| tree | bc97a0cadbe6baa255d9edb83e25c7b99a195c09 /js | |
| parent | 97cb2803d7698bdafc57820017ab8550b031d121 (diff) | |
| parent | ee12ce83057233d271f42162ef3dd2d42d315176 (diff) | |
| download | bootstrap-4775c9296ab95b49fc1e4b0f86d1db26176013ef.tar.xz bootstrap-4775c9296ab95b49fc1e4b0f86d1db26176013ef.zip | |
Merge branch 'dropdown-aria' of git://github.com/mckramer/bootstrap into mckramer-dropdown-aria
Conflicts:
docs/_includes/js/dropdowns.html
Diffstat (limited to 'js')
| -rw-r--r-- | js/dropdown.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/js/dropdown.js b/js/dropdown.js index 88f118c2d..756fc21f5 100644 --- a/js/dropdown.js +++ b/js/dropdown.js @@ -42,7 +42,9 @@ if (e.isDefaultPrevented()) return - $this.trigger('focus') + $this + .trigger('focus') + .attr('aria-expanded', 'true') $parent .toggleClass('open') @@ -88,11 +90,17 @@ if (e && e.which === 3) return $(backdrop).remove() $(toggle).each(function () { - var $parent = getParent($(this)) + var $this = $(this) + var $parent = getParent($this) var relatedTarget = { relatedTarget: this } + if (!$parent.hasClass('open')) return + $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)) + if (e.isDefaultPrevented()) return + + $this.attr('aria-expanded', 'false') $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) }) } |
