2011-08-27 21:46:50 -07:00
|
|
|
(function( $ ){
|
|
|
|
|
|
|
|
/* DROPDOWN PLUGIN DEFINITION
|
|
|
|
* ========================== */
|
|
|
|
|
2011-09-08 20:21:03 -07:00
|
|
|
var selector = 'a.menu, .dropdown-toggle'
|
|
|
|
|
2011-08-27 21:46:50 -07:00
|
|
|
function clearMenus() {
|
2011-09-08 20:21:03 -07:00
|
|
|
$(selector).parent('li').removeClass('open')
|
2011-08-27 21:46:50 -07:00
|
|
|
}
|
|
|
|
|
2011-08-28 16:47:38 -07:00
|
|
|
$(function () {
|
2011-08-28 17:52:55 -07:00
|
|
|
$('body').bind("click", clearMenus)
|
2011-08-28 16:47:38 -07:00
|
|
|
})
|
2011-08-27 21:46:50 -07:00
|
|
|
|
|
|
|
$.fn.dropdown = function ( options ) {
|
|
|
|
return this.each(function () {
|
2011-09-08 20:21:03 -07:00
|
|
|
$(this).delegate(selector, 'click', function (e) {
|
2011-08-27 21:46:50 -07:00
|
|
|
clearMenus()
|
|
|
|
$(this).parent('li').toggleClass('open')
|
|
|
|
return false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
})( jQuery || ender )
|