1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-07-31 19:00:23 +02:00

only overlay dropdowns for mobile

This commit is contained in:
fat
2013-05-16 18:15:34 -07:00
parent a72d0d6e3a
commit f37b351288
7 changed files with 38 additions and 26 deletions

View File

@@ -43,7 +43,10 @@
clearMenus()
if (!isActive) {
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
if ('ontouchstart' in document.documentElement) {
// if mobile we we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
}
$parent.toggleClass('open')
}
@@ -134,6 +137,7 @@
$(document)
.on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)