mirror of
https://github.com/twbs/bootstrap.git
synced 2025-06-04 00:02:59 -04:00
Throw error about Popper.js only when it's needed because some of our plugins don't use it (#24573)
This commit is contained in:
parent
e454c8ec1e
commit
2232b6b4d1
@ -12,14 +12,6 @@ import Util from './util'
|
|||||||
|
|
||||||
const Dropdown = (($) => {
|
const Dropdown = (($) => {
|
||||||
|
|
||||||
/**
|
|
||||||
* Check for Popper dependency
|
|
||||||
* Popper - https://popper.js.org
|
|
||||||
*/
|
|
||||||
if (typeof Popper === 'undefined') {
|
|
||||||
throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)')
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
@ -151,6 +143,14 @@ const Dropdown = (($) => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check for Popper dependency
|
||||||
|
* Popper - https://popper.js.org
|
||||||
|
*/
|
||||||
|
if (typeof Popper === 'undefined') {
|
||||||
|
throw new Error('Bootstrap dropdown require Popper.js (https://popper.js.org)')
|
||||||
|
}
|
||||||
|
|
||||||
let element = this._element
|
let element = this._element
|
||||||
// for dropup with alignment we use the parent as popper container
|
// for dropup with alignment we use the parent as popper container
|
||||||
if ($(parent).hasClass(ClassName.DROPUP)) {
|
if ($(parent).hasClass(ClassName.DROPUP)) {
|
||||||
|
@ -12,15 +12,6 @@ import Util from './util'
|
|||||||
|
|
||||||
const Tooltip = (($) => {
|
const Tooltip = (($) => {
|
||||||
|
|
||||||
/**
|
|
||||||
* Check for Popper dependency
|
|
||||||
* Popper - https://popper.js.org
|
|
||||||
*/
|
|
||||||
if (typeof Popper === 'undefined') {
|
|
||||||
throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)')
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ------------------------------------------------------------------------
|
* ------------------------------------------------------------------------
|
||||||
* Constants
|
* Constants
|
||||||
@ -120,6 +111,13 @@ const Tooltip = (($) => {
|
|||||||
class Tooltip {
|
class Tooltip {
|
||||||
|
|
||||||
constructor(element, config) {
|
constructor(element, config) {
|
||||||
|
/**
|
||||||
|
* Check for Popper dependency
|
||||||
|
* Popper - https://popper.js.org
|
||||||
|
*/
|
||||||
|
if (typeof Popper === 'undefined') {
|
||||||
|
throw new Error('Bootstrap tooltips require Popper.js (https://popper.js.org)')
|
||||||
|
}
|
||||||
|
|
||||||
// private
|
// private
|
||||||
this._isEnabled = true
|
this._isEnabled = true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user