From: Jonathan Persson Date: Fri, 31 Jul 2015 11:30:19 +0000 (+0300) Subject: Merge two jQuery `is()` calls in the button component by using the OR operator in... X-Git-Tag: v3.3.7~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fc26740876eb8d833391bf747bd6677a10405e0d;p=thirdparty%2Fbootstrap.git 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. --- 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