diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-10-23 10:35:27 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2017-10-23 10:35:27 +0300 |
commit | 1487c3a9947b0eb55c61b5d93ff9f0c69a812aeb (patch) | |
tree | 5f05dafe9448cb79d9ea8ffa2dc86a15d3f59ea6 /js/src | |
parent | 0d71a8a738688455746e91f7806fa0515c96d263 (diff) |
Add `Util.jQuery` which will detect jQuery instead of relying on global `$` (#24513)
Diffstat (limited to 'js/src')
-rw-r--r-- | js/src/alert.js | 2 | ||||
-rw-r--r-- | js/src/button.js | 4 | ||||
-rw-r--r-- | js/src/carousel.js | 2 | ||||
-rw-r--r-- | js/src/collapse.js | 2 | ||||
-rw-r--r-- | js/src/dropdown.js | 2 | ||||
-rw-r--r-- | js/src/index.js | 2 | ||||
-rw-r--r-- | js/src/modal.js | 2 | ||||
-rw-r--r-- | js/src/popover.js | 3 | ||||
-rw-r--r-- | js/src/scrollspy.js | 2 | ||||
-rw-r--r-- | js/src/tab.js | 2 | ||||
-rw-r--r-- | js/src/tooltip.js | 2 | ||||
-rw-r--r-- | js/src/util.js | 4 |
12 files changed, 18 insertions, 11 deletions
diff --git a/js/src/alert.js b/js/src/alert.js index 420aa84a30..2b967145f6 100644 --- a/js/src/alert.js +++ b/js/src/alert.js @@ -189,6 +189,6 @@ const Alert = (() => { return Alert -})($) +})(Util.jQuery) export default Alert diff --git a/js/src/button.js b/js/src/button.js index 9227da9516..87e724346f 100644 --- a/js/src/button.js +++ b/js/src/button.js @@ -1,4 +1,6 @@ import $ from 'jquery' +import Util from './util' + /** * -------------------------------------------------------------------------- * Bootstrap (v4.0.0-beta.2): button.js @@ -182,6 +184,6 @@ const Button = (() => { return Button -})($) +})(Util.jQuery) export default Button diff --git a/js/src/carousel.js b/js/src/carousel.js index 964f7fda6e..b5cbf98b48 100644 --- a/js/src/carousel.js +++ b/js/src/carousel.js @@ -519,6 +519,6 @@ const Carousel = (() => { return Carousel -})($) +})(Util.jQuery) export default Carousel diff --git a/js/src/collapse.js b/js/src/collapse.js index 8e84d7b59e..9a21eb7d81 100644 --- a/js/src/collapse.js +++ b/js/src/collapse.js @@ -404,6 +404,6 @@ const Collapse = (() => { return Collapse -})($) +})(Util.jQuery) export default Collapse diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 8fdddd6897..48f87c5aa1 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -445,6 +445,6 @@ const Dropdown = (() => { return Dropdown -})($, Popper) +})(Util.jQuery, Popper) export default Dropdown diff --git a/js/src/index.js b/js/src/index.js index f30b94c576..1697a709b7 100644 --- a/js/src/index.js +++ b/js/src/index.js @@ -33,7 +33,7 @@ import Util from './util' if (version[0] < ltMajor && version[1] < minMinor || version[0] === minMajor && version[1] === minMinor && version[2] < minPatch || version[0] >= maxMajor) { throw new Error('Bootstrap\'s JavaScript requires at least jQuery v1.9.1 but less than v4.0.0') } -})($) +})(Util.jQuery) export { Util, diff --git a/js/src/modal.js b/js/src/modal.js index 07fdc9f4fc..cb7bef0ce3 100644 --- a/js/src/modal.js +++ b/js/src/modal.js @@ -585,6 +585,6 @@ const Modal = (() => { return Modal -})($) +})(Util.jQuery) export default Modal diff --git a/js/src/popover.js b/js/src/popover.js index ff697d85ac..28cb511fc8 100644 --- a/js/src/popover.js +++ b/js/src/popover.js @@ -1,5 +1,6 @@ import $ from 'jquery' import Tooltip from './tooltip' +import Util from './util' /** @@ -189,6 +190,6 @@ const Popover = (() => { return Popover -})($) +})(Util.jQuery) export default Popover diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js index a0e24dd229..12667cc957 100644 --- a/js/src/scrollspy.js +++ b/js/src/scrollspy.js @@ -335,6 +335,6 @@ const ScrollSpy = (() => { return ScrollSpy -})($) +})(Util.jQuery) export default ScrollSpy diff --git a/js/src/tab.js b/js/src/tab.js index 982121cc00..f1d9ec0c82 100644 --- a/js/src/tab.js +++ b/js/src/tab.js @@ -282,6 +282,6 @@ const Tab = (() => { return Tab -})($) +})(Util.jQuery) export default Tab diff --git a/js/src/tooltip.js b/js/src/tooltip.js index ee721a19d0..39ef2594b9 100644 --- a/js/src/tooltip.js +++ b/js/src/tooltip.js @@ -728,6 +728,6 @@ const Tooltip = (() => { return Tooltip -})($, Popper) +})(Util.jQuery, Popper) export default Tooltip diff --git a/js/src/util.js b/js/src/util.js index 16d114b1ab..e3e7797931 100644 --- a/js/src/util.js +++ b/js/src/util.js @@ -154,6 +154,10 @@ const Util = (() => { } } } + }, + + get jQuery() { + return window.jQuery || window.$ } } |