diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-28 23:03:39 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-01-28 23:03:39 +0400 |
commit | d4659521386eab794eaf67f57e8762656aa28de7 (patch) | |
tree | 330c5748a875c135fb8f1a5be4888cb92e33c50b /js | |
parent | ab8f4a394c3ffef58e11c872f27927a9ffe4db11 (diff) |
clean up js api for dropdowns
Diffstat (limited to 'js')
-rw-r--r-- | js/bootstrap-dropdown.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js index 38b6e054fc..48d3ce0f85 100644 --- a/js/bootstrap-dropdown.js +++ b/js/bootstrap-dropdown.js @@ -27,7 +27,10 @@ var toggle = '[data-toggle="dropdown"]' , Dropdown = function ( element ) { - $(element).bind('click', this.toggle) + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) } Dropdown.prototype = { @@ -51,7 +54,6 @@ isActive = $parent.hasClass('open') clearMenus() - !isActive && $parent.toggleClass('open') return false |