From fc26740876eb8d833391bf747bd6677a10405e0d Mon Sep 17 00:00:00 2001 From: Jonathan Persson Date: Fri, 31 Jul 2015 14:30:19 +0300 Subject: [PATCH] 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. --- js/button.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/button.js b/js/button.js index 252531cfe5..dba747c3a4 100644 --- a/js/button.js +++ b/js/button.js @@ -110,7 +110,7 @@ .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { var $btn = $(e.target).closest('.btn') 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 e.preventDefault() // The target component still receive the focus -- 2.47.2