]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Port #19220 to v3
authorChris Rebert <github@chrisrebert.com>
Tue, 16 Feb 2016 12:05:41 +0000 (04:05 -0800)
committerChris Rebert <code@chrisrebert.com>
Tue, 16 Feb 2016 22:24:39 +0000 (14:24 -0800)
js/tests/index.html: Replace jQuery event alias methods with functions that throw explanatory errors, instead of with undefined

Refs https://github.com/twbs/bootstrap/pull/19219#issuecomment-184653699

[skip validator]

js/tests/index.html

index e1fa85131ee8183c2485d5b2733c76cac428175b..e9868d63bc2e4004bb165f8c19bed3a4886724d2 100644 (file)
           'undelegate'
         ]
         for (var i = 0; i < eventAliases.length; i++) {
-          $.fn[eventAliases[i]] = undefined
+          var eventAlias = eventAliases[i]
+          $.fn[eventAlias] = function () {
+            throw new Error('Using the ".' + eventAlias + '()" method is not allowed, so that Bootstrap can be compatible with custom jQuery builds which exclude the "event aliases" module that defines said method. See https://github.com/twbs/bootstrap/blob/master/CONTRIBUTING.md#js')
+          }
         }
       })()
     </script>