diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2012-04-15 03:29:53 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2012-04-15 03:29:53 +0400 |
commit | 575f18aaf49abb0289185f6409bee031947ccf69 (patch) | |
tree | d3548124fab9ba1affe9e056665a46a20432a5c7 /js/bootstrap-dropdown.js | |
parent | 8575a452942001bce522e8e258d9e192d24cb6ec (diff) |
add jshint support + a few minor stylistic changes
Diffstat (limited to 'js/bootstrap-dropdown.js')
-rw-r--r-- | js/bootstrap-dropdown.js | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/js/bootstrap-dropdown.js b/js/bootstrap-dropdown.js index 661b22713c..f27f4d2f43 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 |