Commit b41175f0 authored by Jacob Thornton's avatar Jacob Thornton

Merge pull request #362 from purcell/safe-dropdown-initialization

Add jquery.ready hook after defining plugin, to avoid breakage with modernizr/yepnope 
parents 7e01ff8a bdbb1c92
......@@ -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 );
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment