aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Thornton <[email protected]>2011-10-03 11:46:42 -0700
committerJacob Thornton <[email protected]>2011-10-03 11:46:42 -0700
commitb41175f030505a3b649b2dd26970c18fa1c05832 (patch)
treec998d6513d5e8d2bd19b6d5388da6f141e9cb579
parent7e01ff8a15f9024fdebc3859283ccc1f4c63cec7 (diff)
parentbdbb1c92aab9e9379341c80b8d1c53cc14ac7198 (diff)
downloadbootstrap-b41175f030505a3b649b2dd26970c18fa1c05832.tar.xz
bootstrap-b41175f030505a3b649b2dd26970c18fa1c05832.zip
Merge pull request #362 from purcell/safe-dropdown-initialization
Add jquery.ready hook after defining plugin, to avoid breakage with modernizr/yepnope
-rw-r--r--js/bootstrap-dropdown.js27
1 files changed, 15 insertions, 12 deletions
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index a3b0b0dfa..68a3db5f2 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -20,17 +20,6 @@
!function( $ ){
- var d = 'a.menu, .dropdown-toggle'
-
- function clearMenus() {
- $(d).parent('li').removeClass('open')
- }
-
- $(function () {
- $('html').bind("click", clearMenus)
- $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
- })
-
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
@@ -47,4 +36,18 @@
})
}
-}( window.jQuery || window.ender ); \ No newline at end of file
+ /* APPLY TO STANDARD DROPDOWN ELEMENTS
+ * =================================== */
+
+ var d = 'a.menu, .dropdown-toggle'
+
+ function clearMenus() {
+ $(d).parent('li').removeClass('open')
+ }
+
+ $(function () {
+ $('html').bind("click", clearMenus)
+ $('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
+ })
+
+}( window.jQuery || window.ender );