diff options
| author | Mark Otto <[email protected]> | 2012-12-08 17:40:42 -0800 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2012-12-08 17:40:42 -0800 |
| commit | bc0b94a3fdc8fe480c74f4494073e2c0addb265e (patch) | |
| tree | e13fec2ed829b4586fa4044fffc8dbfadddae54e /js/bootstrap-dropdown.js | |
| parent | be5f31480b53555c492e0077c8bb9f419fc48f62 (diff) | |
| parent | 9376a7c221a64c2bf508d02ea2ccd85748d10fcc (diff) | |
| download | bootstrap-bc0b94a3fdc8fe480c74f4494073e2c0addb265e.tar.xz bootstrap-bc0b94a3fdc8fe480c74f4494073e2c0addb265e.zip | |
Merge branch 'master' into 3.0.0-wip
Conflicts:
docs/assets/css/bootstrap.css
docs/assets/js/bootstrap.js
docs/css.html
docs/templates/pages/base-css.mustache
docs/templates/pages/components.mustache
docs/templates/pages/javascript.mustache
less/breadcrumbs.less
less/tables.less
less/tests/css-tests.html
Diffstat (limited to 'js/bootstrap-dropdown.js')
| -rw-r--r-- | js/bootstrap-dropdown.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js index f35b09746..65fc3ea86 100644 --- a/js/bootstrap-dropdown.js +++ b/js/bootstrap-dropdown.js @@ -53,9 +53,10 @@ if (!isActive) { $parent.toggleClass('open') - $this.focus() } + $this.focus() + return false } @@ -82,7 +83,7 @@ if (!isActive || (isActive && e.keyCode == 27)) return $this.click() - $items = $('[role=menu] li:not(.divider) a', $parent) + $items = $('[role=menu] li:not(.divider):visible a', $parent) if (!$items.length) return @@ -124,6 +125,8 @@ /* DROPDOWN PLUGIN DEFINITION * ========================== */ + var old = $.fn.dropdown + $.fn.dropdown = function (option) { return this.each(function () { var $this = $(this) @@ -136,6 +139,15 @@ $.fn.dropdown.Constructor = Dropdown + /* DROPDOWN NO CONFLICT + * ==================== */ + + $.fn.dropdown.noConflict = function () { + $.fn.dropdown = old + return this + } + + /* APPLY TO STANDARD DROPDOWN ELEMENTS * =================================== */ |
