]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Merge two jQuery `is()` calls in the button component by using the OR operator in...
authorJonathan Persson <persson.jonathan@gmail.com>
Fri, 31 Jul 2015 11:30:19 +0000 (14:30 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Sun, 29 May 2016 09:18:29 +0000 (12:18 +0300)
Closes #16918.

js/button.js

index 252531cfe5b7361e50888c31702a60809299bb56..dba747c3a40d38130889789ea4f9427755a3ddf8 100644 (file)
     .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