aboutsummaryrefslogtreecommitdiff
path: root/js/bootstrap-dropdown.js
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2012-04-14 17:16:37 -0700
committerMark Otto <[email protected]>2012-04-14 17:16:37 -0700
commitce30d19c1507e71199f7dbbf680cf0d2b0ea6477 (patch)
tree1279731abc8cf141a3fd683282ad2cae32ae6653 /js/bootstrap-dropdown.js
parentdbde2dc9e40f077af4fcaa1714ade7bc94398da9 (diff)
parent3408064d00bc1e4322c3ea1575bc2cab5aaa2be2 (diff)
downloadbootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.tar.xz
bootstrap-ce30d19c1507e71199f7dbbf680cf0d2b0ea6477.zip
Merge branch '2.0.3-wip' of github.com:twitter/bootstrap into 2.0.3-wip
Conflicts: docs/assets/bootstrap.zip
Diffstat (limited to 'js/bootstrap-dropdown.js')
-rw-r--r--js/bootstrap-dropdown.js16
1 files changed, 9 insertions, 7 deletions
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js
index 661b22713..f27f4d2f4 100644
--- a/js/bootstrap-dropdown.js
+++ b/js/bootstrap-dropdown.js
@@ -18,15 +18,16 @@
* ============================================================ */
-!function ( $ ) {
+!function ($) {
+
+ "use strict"; // jshint ;_;
- "use strict"
/* DROPDOWN CLASS DEFINITION
* ========================= */
var toggle = '[data-toggle="dropdown"]'
- , Dropdown = function ( element ) {
+ , Dropdown = function (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', function () {
$el.parent().removeClass('open')
@@ -37,7 +38,7 @@
constructor: Dropdown
- , toggle: function ( e ) {
+ , toggle: function (e) {
var $this = $(this)
, selector = $this.attr('data-target')
, $parent
@@ -54,7 +55,8 @@
isActive = $parent.hasClass('open')
clearMenus()
- !isActive && $parent.toggleClass('open')
+
+ if (!isActive) $parent.toggleClass('open')
return false
}
@@ -69,7 +71,7 @@
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
- $.fn.dropdown = function ( option ) {
+ $.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('dropdown')
@@ -91,4 +93,4 @@
.on('click.dropdown.data-api', toggle, Dropdown.prototype.toggle)
})
-}( window.jQuery ); \ No newline at end of file
+}(window.jQuery); \ No newline at end of file