aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorfat <[email protected]>2013-05-16 18:15:34 -0700
committerfat <[email protected]>2013-05-16 18:15:34 -0700
commitf37b351288883cca4ea435827b10fe6d8475dc6e (patch)
treee29d493a4e8b630acb6b75371ffb5335eb8ca65b /js
parenta72d0d6e3a5f2691eaa7e036a7b081d021097159 (diff)
downloadbootstrap-f37b351288883cca4ea435827b10fe6d8475dc6e.tar.xz
bootstrap-f37b351288883cca4ea435827b10fe6d8475dc6e.zip
only overlay dropdowns for mobile
Diffstat (limited to 'js')
-rw-r--r--js/dropdown.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/js/dropdown.js b/js/dropdown.js
index c76162b1c..d9acdd2e8 100644
--- a/js/dropdown.js
+++ b/js/dropdown.js
@@ -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)