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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user