mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-29 21:52:22 +01:00
Merge two jQuery is()
calls in the button component by using the OR operator in the selector instead of two function calls with the OR operator between them.
Closes #16918.
This commit is contained in:
parent
21d9175fef
commit
fc26740876
@ -110,7 +110,7 @@
|
|||||||
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
.on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) {
|
||||||
var $btn = $(e.target).closest('.btn')
|
var $btn = $(e.target).closest('.btn')
|
||||||
Plugin.call($btn, 'toggle')
|
Plugin.call($btn, 'toggle')
|
||||||
if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) {
|
if (!($(e.target).is('input[type="radio"], input[type="checkbox"]'))) {
|
||||||
// Prevent double click on radios, and the double selections (so cancellation) on checkboxes
|
// Prevent double click on radios, and the double selections (so cancellation) on checkboxes
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
// The target component still receive the focus
|
// The target component still receive the focus
|
||||||
|
Loading…
x
Reference in New Issue
Block a user