Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Bootstrap
bootstrap
Commits
2232b6b4
Commit
2232b6b4
authored
7 years ago
by
Johann-S
Committed by
Mark Otto
7 years ago
Browse files
Options
Download
Email Patches
Plain Diff
Throw error about Popper.js only when it's needed because some of our plugins don't use it (#24573)
parent
e454c8ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
js/src/dropdown.js
+8
-8
js/src/dropdown.js
js/src/tooltip.js
+7
-9
js/src/tooltip.js
with
15 additions
and
17 deletions
+15
-17
js/src/dropdown.js
+
8
-
8
View file @
2232b6b4
...
@@ -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
))
{
...
...
This diff is collapsed.
Click to expand it.
js/src/tooltip.js
+
7
-
9
View file @
2232b6b4
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets