mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-17 19:21:23 +03: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:
committed by
XhmikosR
parent
21d9175fef
commit
fc26740876
+1
-1
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user