mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-25 21:09:06 +02:00
move js plugins to root dir, begin writing tests, and change modal plugin to be more boss like
This commit is contained in:
26
js/bootstrap-dropdown.js
vendored
Normal file
26
js/bootstrap-dropdown.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
(function( $ ){
|
||||
|
||||
/* DROPDOWN PLUGIN DEFINITION
|
||||
* ========================== */
|
||||
|
||||
var selector = 'a.menu, .dropdown-toggle'
|
||||
|
||||
function clearMenus() {
|
||||
$(selector).parent('li').removeClass('open')
|
||||
}
|
||||
|
||||
$(function () {
|
||||
$('body').bind("click", clearMenus)
|
||||
})
|
||||
|
||||
$.fn.dropdown = function ( options ) {
|
||||
return this.each(function () {
|
||||
$(this).delegate(selector, 'click', function (e) {
|
||||
clearMenus()
|
||||
$(this).parent('li').toggleClass('open')
|
||||
return false
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
})( jQuery || ender )
|
Reference in New Issue
Block a user