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

update more readme changes - introduce target specificty convention to more plugins

This commit is contained in:
Jacob Thornton
2011-12-20 23:28:48 -08:00
parent c4364285e4
commit f72a94ae28
12 changed files with 76 additions and 51 deletions

View File

@@ -35,11 +35,15 @@
constructor: Dropdown
, toggle: function ( e ) {
var li = $(this).parent('li')
, isActive = li.hasClass('open')
var $this = $(this)
, selector = $this.attr('data-target') || $this.attr('href')
, $parent = $(selector)
$parent.length || ($parent = $this.parent())
clearMenus()
!isActive && li.toggleClass('open')
!$parent.hasClass('open') && $parent.toggleClass('open')
return false
}
@@ -47,7 +51,7 @@
}
function clearMenus() {
$(toggle).parent('li').removeClass('open')
$(toggle).parent().removeClass('open')
}
@@ -63,6 +67,8 @@
})
}
$.fn.dropdown.Constructor = Dropdown
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */