Commit 2232b6b4 authored by Johann-S's avatar Johann-S Committed by Mark Otto
Browse files

Throw error about Popper.js only when it's needed because some of our plugins don't use it (#24573)

parent e454c8ec
Showing with 15 additions and 17 deletions
+15 -17
...@@ -12,14 +12,6 @@ import Util from './util' ...@@ -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 = (($) => { ...@@ -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' ...@@ -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 = (($) => { ...@@ -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
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment