1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-26 13:29:06 +02:00

change hella js... broke all the tests. i <3 wip

This commit is contained in:
Jacob Thornton
2011-09-11 20:08:43 -07:00
parent d9cbcfc20d
commit 173be3f1e8
7 changed files with 376 additions and 217 deletions

View File

@@ -20,22 +20,23 @@
(function( $ ){
var selector = 'a.menu, .dropdown-toggle'
var d = 'a.menu, .dropdown-toggle'
function clearMenus() {
$(selector).parent('li').removeClass('open')
$(d).parent('li').removeClass('open')
}
$(function () {
$('body').bind("click", clearMenus)
$('html').bind("click", clearMenus)
$('body').dropdown( '[data-dropdown] a.menu, [data-dropdown] .dropdown-toggle' )
})
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function ( options ) {
$.fn.dropdown = function ( selector ) {
return this.each(function () {
$(this).delegate(selector, 'click', function (e) {
$(this).delegate(selector || d, 'click', function (e) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')