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