diff options
author | Johann-S <johann.servoire@gmail.com> | 2017-10-30 01:51:04 +0300 |
---|---|---|
committer | Mark Otto <markd.otto@gmail.com> | 2017-10-30 01:51:04 +0300 |
commit | 2232b6b4d140cf8a01314deb7e4779c7fde8ab05 (patch) | |
tree | 7c3d0ec4a290b48b5d7d541247a0e6203a988776 /js/src/dropdown.js | |
parent | e454c8ec1e5197d959baf48fb089719bf900fb2a (diff) |
Throw error about Popper.js only when it's needed because some of our plugins don't use it (#24573)
Diffstat (limited to 'js/src/dropdown.js')
-rw-r--r-- | js/src/dropdown.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 45d061c93a..a18f0c28ae 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -13,14 +13,6 @@ import Util from './util' 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 * ------------------------------------------------------------------------ @@ -151,6 +143,14 @@ const Dropdown = (($) => { 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 // for dropup with alignment we use the parent as popper container if ($(parent).hasClass(ClassName.DROPUP)) { |