1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-12 08:34:08 +02:00

Be consistent with Popper's name. (#32224)

The npm package is named "popper.js" but the project is named "Popper", so use the latter consistently.
This commit is contained in:
XhmikosR
2020-11-21 16:22:08 +02:00
committed by GitHub
parent 358c36d4b5
commit f4457bca02
14 changed files with 48 additions and 48 deletions

View File

@@ -156,10 +156,10 @@ class Dropdown {
return
}
// Disable totally Popper.js for Dropdown in Navbar
// Totally disable Popper for Dropdowns in Navbar
if (!this._inNavbar) {
if (typeof Popper === 'undefined') {
throw new TypeError('Bootstrap\'s dropdowns require Popper.js (https://popper.js.org)')
throw new TypeError('Bootstrap\'s dropdowns require Popper (https://popper.js.org)')
}
let referenceElement = this._element
@@ -329,7 +329,7 @@ class Dropdown {
}
}
// Disable Popper.js if we have a static display
// Disable Popper if we have a static display
if (this._config.display === 'static') {
popperConfig.modifiers.applyStyle = {
enabled: false

View File

@@ -125,7 +125,7 @@ const TRIGGER_MANUAL = 'manual'
class Tooltip {
constructor(element, config) {
if (typeof Popper === 'undefined') {
throw new TypeError('Bootstrap\'s tooltips require Popper.js (https://popper.js.org)')
throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)')
}
// private

View File

@@ -100,7 +100,7 @@ describe('Dropdown', () => {
expect(dropdown.toggle).toHaveBeenCalled()
})
it('should allow to pass config to popper.js with `popperConfig`', () => {
it('should allow to pass config to Popper with `popperConfig`', () => {
fixtureEl.innerHTML = [
'<div class="dropdown">',
' <button class="btn dropdown-toggle" data-bs-toggle="dropdown">Dropdown</button>',
@@ -841,7 +841,7 @@ describe('Dropdown', () => {
expect(dropdown._element).toBeNull()
})
it('should dispose dropdown with popper.js', () => {
it('should dispose dropdown with Popper', () => {
fixtureEl.innerHTML = [
'<div class="dropdown">',
' <button class="btn dropdown-toggle" data-bs-toggle="dropdown">Dropdown</button>',
@@ -872,7 +872,7 @@ describe('Dropdown', () => {
})
describe('update', () => {
it('should call popper.js and detect navbar on update', () => {
it('should call Popper and detect navbar on update', () => {
fixtureEl.innerHTML = [
'<div class="dropdown">',
' <button class="btn dropdown-toggle" data-bs-toggle="dropdown">Dropdown</button>',
@@ -1005,7 +1005,7 @@ describe('Dropdown', () => {
btnDropdown.click()
})
it('should not use popper.js in navbar', done => {
it('should not use Popper in navbar', done => {
fixtureEl.innerHTML = [
'<nav class="navbar navbar-expand-md navbar-light bg-light">',
' <div class="dropdown">',
@@ -1022,14 +1022,14 @@ describe('Dropdown', () => {
const dropdownMenu = fixtureEl.querySelector('.dropdown-menu')
dropdownEl.addEventListener('shown.bs.dropdown', () => {
expect(dropdownMenu.getAttribute('style')).toEqual(null, 'no inline style applied by popper.js')
expect(dropdownMenu.getAttribute('style')).toEqual(null, 'no inline style applied by Popper')
done()
})
btnDropdown.click()
})
it('should not use popper.js if display set to static', done => {
it('should not use Popper if display set to static', done => {
fixtureEl.innerHTML = [
'<div class="dropdown">',
' <button class="btn dropdown-toggle" data-bs-toggle="dropdown" data-bs-display="static">Dropdown</button>',
@@ -1044,7 +1044,7 @@ describe('Dropdown', () => {
const dropdownMenu = fixtureEl.querySelector('.dropdown-menu')
dropdownEl.addEventListener('shown.bs.dropdown', () => {
// popper.js add this attribute when we use it
// Popper adds this attribute when we use it
expect(dropdownMenu.getAttribute('x-placement')).toEqual(null)
done()
})

View File

@@ -107,7 +107,7 @@ describe('Tooltip', () => {
tooltipInContainerEl.click()
})
it('should allow to pass config to popper.js with `popperConfig`', () => {
it('should allow to pass config to Popper with `popperConfig`', () => {
fixtureEl.innerHTML = '<a href="#" rel="tooltip">'
const tooltipEl = fixtureEl.querySelector('a')

View File

@@ -196,7 +196,7 @@
<div class="col-sm-3 mt-4">
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-bs-toggle="dropdown" data-bs-display="static" aria-expanded="false">
Dropdown menu without Popper.js
Dropdown menu without Popper
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<li><a class="dropdown-item" href="#">Action</a></li>