mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-10 23:54:08 +02:00
Add Util.jQuery
which will detect jQuery instead of relying on global $
(#24513)
This commit is contained in:
@@ -189,6 +189,6 @@ const Alert = (() => {
|
||||
|
||||
return Alert
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default Alert
|
||||
|
@@ -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
|
||||
|
@@ -519,6 +519,6 @@ const Carousel = (() => {
|
||||
|
||||
return Carousel
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default Carousel
|
||||
|
@@ -404,6 +404,6 @@ const Collapse = (() => {
|
||||
|
||||
return Collapse
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default Collapse
|
||||
|
@@ -445,6 +445,6 @@ const Dropdown = (() => {
|
||||
|
||||
return Dropdown
|
||||
|
||||
})($, Popper)
|
||||
})(Util.jQuery, Popper)
|
||||
|
||||
export default Dropdown
|
||||
|
@@ -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,
|
||||
|
@@ -585,6 +585,6 @@ const Modal = (() => {
|
||||
|
||||
return Modal
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default Modal
|
||||
|
@@ -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
|
||||
|
@@ -335,6 +335,6 @@ const ScrollSpy = (() => {
|
||||
|
||||
return ScrollSpy
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default ScrollSpy
|
||||
|
@@ -282,6 +282,6 @@ const Tab = (() => {
|
||||
|
||||
return Tab
|
||||
|
||||
})($)
|
||||
})(Util.jQuery)
|
||||
|
||||
export default Tab
|
||||
|
@@ -728,6 +728,6 @@ const Tooltip = (() => {
|
||||
|
||||
return Tooltip
|
||||
|
||||
})($, Popper)
|
||||
})(Util.jQuery, Popper)
|
||||
|
||||
export default Tooltip
|
||||
|
@@ -154,6 +154,10 @@ const Util = (() => {
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
get jQuery() {
|
||||
return window.jQuery || window.$
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user