diff options
author | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-07-21 22:11:45 +0400 |
---|---|---|
committer | Gleb Mazovetskiy <glex.spb@gmail.com> | 2014-07-21 22:11:45 +0400 |
commit | f5ee26fc989b39f6ad8f623083140a070482ebb7 (patch) | |
tree | 91d8c678c8bb7048f6d5f8b1b1fb39a2662fb8a0 /assets/javascripts/bootstrap.js | |
parent | 43a76e57c9e3d8c53603ef0956b80e9dfcb24931 (diff) |
rake convert
Diffstat (limited to 'assets/javascripts/bootstrap.js')
-rw-r--r-- | assets/javascripts/bootstrap.js | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/assets/javascripts/bootstrap.js b/assets/javascripts/bootstrap.js index a7870a9c..f1c50206 100644 --- a/assets/javascripts/bootstrap.js +++ b/assets/javascripts/bootstrap.js @@ -333,15 +333,6 @@ } - // FOCUS SHIM (FOR BUTTON GROUPS) - // ============================== - - function getBtnTarget(target) { - var $target = $(target) - return $target.hasClass('btn') ? $target : $target.parent('.btn') - } - - // BUTTON DATA-API // =============== @@ -352,11 +343,8 @@ Plugin.call($btn, 'toggle') e.preventDefault() }) - .on('focus.bs.button.data-api', '[data-toggle^="button"]', function (e) { - getBtnTarget(e.target).addClass('focus') - }) - .on('blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { - getBtnTarget(e.target).removeClass('focus') + .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { + $(e.target).closest('.btn').toggleClass('focus', e.type == 'focus') }) }(jQuery); |